[dev] DB Migration questions

Michael M Slusarz slusarz at horde.org
Wed May 26 16:08:05 UTC 2010


Quoting Jan Schneider <jan at horde.org>:

> Zitat von Michael M Slusarz <slusarz at horde.org>:
>
>> Quoting Jan Schneider <jan at horde.org>:
>>
>>> For a fresh install, just run "db_migrate imp". Since there is no  
>>> schema version in the database, all scripts will be run.
>>>
>>> If upgrading from IMP 4 to 5 run "db_migrate imp 1" (or 2?). Since  
>>> a version is provided, the database is not checked for a schema  
>>> version and only the upgrade scripts will be run.
>>
>> Couldn't this easily be handled by some checks in the migration  
>> scripts though?  i.e. the migration scripts are run (db_migrate  
>> imp), if no schema table is found we attempt to run ALL scripts,  
>> but table creation scripts could easily add a table exists check  
>> and skip the creation if the table already exists.  This prevents  
>> users from having to know what exact migrate version number they  
>> need to enter.
>
> This seems a bit fragile to me. I think explicitly providing a  
> schema version with the migration script is much safer than assuming  
> some schema version from the mere existence of a table.

I would still prefer an approach where people either on an upgrade  
path (from the previous version) or a new install simply has to run  
"../db_migrate [app]".  If just for the fact that it makes  
installation, and the corresponding installation docs, much cleaner.   
I subscribe to the thought that this is one of the main areas that H4  
needs to improve on - ease of installation.

michael

-- 
___________________________________
Michael Slusarz [slusarz at horde.org]




More information about the dev mailing list