[development] Data-driven database tables and updates

Khalid B kb at 2bits.com
Fri Jun 9 13:30:22 UTC 2006


> function modulename_schema() {
>
>    $tables['event']['#charset'] = 'utf8';
>
>    $tables['event']['nid'] = array(
>      '#type' => DB_INT,
>      '#dispwidth' => 10,
>      '#signed' => FALSE,
>      '#null' => FALSE,
>      '#default' => '0');
>
>    $tables['event']['event_start'] = array(...);
>
>    ...;
>
>    return $tables;
> }

Adrian Roussow is working on something like this already.

This will make the schema more portable across PostgreSQL and MySQL
and other databases.

Check the previous discussion here
http://lists.drupal.org/pipermail/development/2006-May/015962.html


More information about the development mailing list