Database migrations

Joomlatools Platform uses Phinx to manage database migrations. This makes it very easy to upgrade to newer versions without having to worry about breaking your database schema.

After you’ve pulled in the latest changes of the codebase, run:

php vendor/bin/phinx migrate

This brings your database schema up to date with the new version.

Creating your own migrations

If you want to add a custom migration, execute:

php vendor/bin/phinx create MyCustomMigration

A new PHP file will be created in the install/mysql/migrations directory for you to edit.

Creating a migration from your extension

To create custom migrations from your own extension, create a migration directory within your extension folder:

mkdir -p app/administrator/components/com_[yourextension]/resources/install/mysql/migrations

After this, create a migration and Phinx will ask you where you want to place the PHP file:

php vendor/bin/phinx create MyExtensionMigration

More information can be found in their extensive documentation.

Need Help?

Let our developers personally assist you. You can ask development related questions in our Support Center. Only for Business or Agency subscribers.