[development] versioned schema?

Earnie Boyd earnie at users.sourceforge.net
Wed Jun 13 12:43:09 UTC 2007


Quoting Peter Wolanin <pwolanin at gmail.com>:

> It's not something I would recommend either, but it's an option some
> module developers might choose.
>
> -Peter
>
> On 12 Jun 2007 17:58:11 -0400, Barry Jaspan <barry at jaspan.org> wrote:
>>
>> > One could minimize the code by making changes to the array rather than
>> > re-declaring the whole thing. Something like:
>> >
>> > node_schema_6000() {
>> >   $schema = node_schema_5000();
>> >
>> >   $schema['node']['fields']['newcolumn'] = array('type' => 'int', 'not
>> > null' => TRUE, 'default' => 1);
>> >
>> >   return $schema;
>> > }
>>
>> The downside here is that there is nowhere a developer can look to
>> find the current node_schema.  Well, actually, schema.module can
>> easily provide this, but (I suspect) developers would prefer to look
>> at a file than visit a Drupal page for this info.
>>

Why not store the schema to the DB on install/update?  I understand the 
catch 22 but {schema} could be the first table on install.  Of course 
this would introduce another cache but the cache would only need to be 
rebuilt on schema update.

Earnie


More information about the development mailing list