[development] Module install / database schema doubt
Vaibhav Jain
in.vaibhavjain at gmail.com
Thu Mar 17 04:09:39 UTC 2011
you can use schema module to generate the install file contents.
On Thu, Mar 17, 2011 at 9:14 AM, Austin Einter <austin.einter at gmail.com>wrote:
> Hi All
> I have a small install file as below.
>
> *<?php
> function resume_submit_install()
> {
> drupal_install_schema('resume_table');
> }
> function resume_submit_uninstall()
> {
> drupal_uninstall_schema('resume_table');
> }
> function resume_table_schema()
> {
> $schema['resume_table'] = array(
>
> 'fields' => array(
> 'uid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' =>
> TRUE, 'default' => 0),
> 'name' => array('type' => 'varchar', 'not null' => TRUE, 'default' =>
> ''),
> 'email' => array('type' => 'varchar', 'not null' => TRUE, 'default' =>
> ''),
> 'altemail' => array('type' => 'varchar', 'not null' => TRUE, 'default'
> => ''),
> ),
>
> 'indexes' => array('uid' => array('uid'),),
>
> 'primary key' => array('name'),
> );*
> * return $schema;
> }*
>
>
> When I install the custom module, it installs without any warning/error.
> But on form submit, when I try to save some data, it gives warning (table
> does not exist).
>
> Can somebody help me to understand, what could be the issue.
>
> Thanks
> Austin
>
--
Regards,
Vaibhav Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/development/attachments/20110317/da3667b7/attachment.html
More information about the development
mailing list