Wiki

Clone wiki

Anano 2 / Migrations

Home

Migrations

Migrations are an easy way to set up your databases and add them to your version control, without the hassle of dumping and versioning .sql-files, etc. Their use is highly recommended.

Usage

To create a table migration, the easiest way is to use the Anano console.

From the project root, type php run migrate:make <name-of-your-table>

Remember: Migrations create tables, not models, so by following the standard table naming convention, you would use the plural form here. E.g. to create a users table, you would type:

php run migrate:make users

This will create a boilerplate migration for you in the /app/database/migrations folder. Open this file, edit it to your liking (see below), and run php run migrate:up to execute the migrations and

Updated