Migrations

Note

Ubiquity migrations are not really migrations. Migrations are not done from php code, written or generated.
They consist in generating the SQL code allowing to update the database from the cache of the existing models.

Updating an existing model

Consider the following model representing a user:

../../_images/user-model.png

Let’s add a phone field, with the devtools:

Ubiquity model
../../_images/add-field-phone.png

Migrations

Starting by displaying the information on possible migrations:

Ubiquity info-migrations
../../_images/info-migrations-1.png

We can then proceed to the execution:

Ubiquity migrations
../../_images/migrations-1.png