[commits] [Wiki] changed: UpdatingYourDatabaseSchema
Wiki Guest
wikiguest at horde.org
Thu Dec 18 10:30:24 UTC 2014
guest [80.153.12.208] Thu, 18 Dec 2014 10:30:24 +0000
Modified page: http://wiki.horde.org/UpdatingYourDatabaseSchema
New Revision: 2
Change log: formatting, typos
@@ -2,9 +2,9 @@
+ Migration Mechanism
When you take your application to a new revision, you may whish to
change your SQL database schema. Tables may be added or removed and
columns in a table may be added or removed. For this, horde provides
the migration mechanism.
-+ Files
+++ Files
Files under
<code type="shell">
<appname>/migration/
@@ -24,12 +24,14 @@
</code>
Note that the file name is all lowercase and the class name is
CamelCase. The class may define an "up" for upgrading an installation
and a "down" method for removing the installation, for instance if you
which to remove your application from the horde system. For
implementation of the methods feel free to steal code from one of the
existing horde applications.
Usage
+
+++ Usage
When you use the admin console, horde determines if the revision
number of your application matches the highest number of migration
files found. If not, the console notifies you ("DB schema needs
update") and lets you trigger the migration process with the click of
a button. All migration files with numbers between the current
revision and the highest number found in a file name will the be
considered and the up-methods of those files will be called. The
revision number of your application will be set accordingly. Note that
this revision number will not necessarily match the version number
defined in
<code type="shell">
<application>/lib/Application.php
</code>
-Alternatively, you may run the CLI script horde-db-migrate, which
should already be in your shell search path. The CLI is especially
useful for re-running a migration script as horde will not notice a
change in one of the migration files. It also acdcepts a revision
number to set.
+Alternatively, you may run the CLI script horde-db-migrate, which
should already be in your shell search path. The CLI is especially
useful for re-running a migration script as horde will not notice a
change in one of the migration files. the tool also accepts a revision
number to set.
More information about the commits
mailing list