[doc] DB migration mechanism

Sebastian Birnbach birnbacs at gmail.com
Thu Dec 18 08:24:17 UTC 2014


Thanks Ralph but this still leaves some questions open.

I understand the migration mechanism is provided to allow a DB schema
update without losing data.

File naming appears to follow this pattern:
<n>_<appname>_[base|upgrade]_<name>.php.
The class defined in the file must then be called
<Appname>[Base|Upgrade]<Name>.

Questions:
* what is the difference between base and upgrade? If the scripts are
always executed in ascending order this difference is not self explanatory.
* are there more choices to [base|upgrade]?
* The admin console appears to detect if a file in migration/ was not
executed. However, it does not test if one of the files was modified after
last time it was executed, right? So for repeated execution (development) I
must use
horde-db-migrate <appname> down; horde-db-migrate <appname> up

* speaking of horde-db-migrate, I have some issues there (maybe not the
correct mailing list, please forgive)
  + upon usage it outputs about 100 warnings, mostly about violated PHP
strict standards and the use of deprecated functions.
  + it will run under permissions of any user but only produce meaningful
output if run as superuser
Is this normal?

Thanks

  Sebastian



2014-12-17 7:29 GMT+01:00 Ralf Lang <lang at b1-systems.de>:
>
> On 16.12.2014 22:02, Sebastian Birnbach wrote:
> > schemas can be controlled through files in <appname>/migration/*. The
> > admin console will notice a new file in this directory and offer the
> > right  "update DB schema"-button, which will call the "up" function
> > defined in the file.
> >
> > Unfortunately, this is about all I could find on the upgrade mechanism.
> > Too little for using or understanding it, especially since the file
> > naming convention is unclear to me.
>
> Use the horde-db-migrate cli script instead to get a deeper
> understanding. The current schema version is stored in a separate table
>
> The naming schema is Number_Classname, where Number is the order in
> which they are applied and Classname is derived from Horde_DB_Migration
> - see kronolith/migration to get an idea.
>
> --
> Ralf Lang
> Linux Consultant / Developer
> Tel.: +49-170-6381563
> Mail: lang at b1-systems.de
> B1 Systems GmbH
> Osterfeldstraße 7 / 85088 Vohburg / http://www.b1-systems.de
> GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
>
>
> --
> doc mailing list
> Frequently Asked Questions: http://wiki.horde.org/FAQ
> To unsubscribe, mail: doc-unsubscribe at lists.horde.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.horde.org/archives/doc/attachments/20141218/9ccd54a4/attachment.html>


More information about the doc mailing list