I'm trying to build a content type with a module. At this moment, I've created the Schema and Form implementations:
Schema:
<?php
/**
* Implements hook_schema().
* @file Creates database tables for mymodule.
*/
function mymodule_schema() {
$schema['mymodule'] = array(
'description' => 'Stores which node is a {mymodule}.',
'fields' => array(
'nid' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => "The {node}.nid.",
),
'desc' => array(
'type' => 'varchar',
'not null' => FALSE,
'default' => '',
'length' => 300,
'description' => "Content's description.",
),
'active' => array(
'type' => 'int',
'unsigned' => TRUE,
'not null' => TRUE,
'default' => 0,
'description' => 'Boolean indicating whether or not the content is open.',
),
),
'primary key' => array('nid'),
'foreign keys' => array(
'node' => array(
'table' => 'node',
'columns' => array('nid' => 'nid'),
),
),
);
//There are more table columns, but I need theese now to try...
return $schema;
}
mymodule Form:
<?php
<?php