Hi,
I have created the table in .install file, other than date field its working fine for all data types. I dont know why its showing error when i add the date field while creating tables.
This is the .install file i am trying to create.
/*******************************************************************************************
* Implementation of hook_install().
*/
function cherieo_store_module_test_install() {
drupal_install_schema('cherieo_store_module_test');
}
/**
* Implementation of hook_uninstall().
*/
function cherieo_store_module_test_uninstall() {
drupal_uninstall_schema('cherieo_store_module_test');
}
/**
* Implementation of hook_schema().
*/
function cherieo_store_module_test_schema() {
$schema['cherieo_store_module_test'] = array(
'description' => t('Stores information of store users.'),
'fields' => array(
'Store_ID' => array(
'type' => 'serial',
'not null' => TRUE,
'description' => t('Primary Key: Unique Store_Code.'),
),
'User_Name' => array(
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'description' => t('Name of the user.'),
),
'Password' => array(
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'description' => t('Password for the user.'),
),
'Date' => array(
'type' => 'date',
'not null' => TRUE,
),
),
'primary key' => array('Store_ID'),
'unique keys' => array('Store_Code' => array('Store_Code')),
);
return $schema;
}
/***********************************************************************************
Please give an idea..
Thanks,
Venu