Skip to content
fireproofsocks edited this page Dec 11, 2014 · 2 revisions

Migrate

Run database migrations defined in the project's migrations directory (see "migrations_path"). Migrations are structural changes to your database, e.g. used to create or modify custom tables. Be careful when running them: the normal behavior is to flush all data from your table.

Usage:

php repoman migrate <pkg_root_dir> [options]

Migrate will first execute the "uninstall.php" script to clean out the database, then it will run the "install.php" script to add necessary packages using addPackage() and create custom tables.

Parameters:

--from : a valid version number. Normal behavior is to uninstall all migrations, then install them: this guarantees that the local environment is in the most current state. If you wish to preserve data or test your update scripts, you can skip the uninstall and install process and instead run only the updates starting with the referenced version number.

--log_level : integer. Default is 3 (info), but you may wish to set this to 4 while troubleshooting. This option is available to all Repoman functions.

Your install.php file should include the necessary addPackage() calls so that custom data classes can be used and their corresponding database tables can be accessed.