function import_user_schema in Import 6
Implementation of hook_schema().
File
- examples/
import_user/ import_user.install, line 40 - The install file for the import_user example. This module should not be used on a production installation of Drupal ... it is for illustration purposes only. The install hook removes all traces of what was created by this module and could…
Code
function import_user_schema() {
$schema['import_example_user'] = array(
'description' => t('Example table for a user import.'),
'fields' => array(
'id' => array(
'description' => t('Primary key: ID'),
'type' => 'serial',
),
'email' => array(
'description' => t('The users email address.'),
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'name' => array(
'description' => t('The users name.'),
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'random_username' => array(
'description' => t('A random user name.'),
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
'random_password' => array(
'description' => t('A random password.'),
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
'default' => '',
),
),
'primary key' => array(
'id',
),
);
return $schema;
}