CakePHP3 Database Migration Commands

A list of a few helpful commands to use when creating database migration files.

Check the status of migrations

This would show something like the following

 Migrate (up) All Pending Migrations

 Rollback (Down) Last Migration

 Create a New Migration File

The above command should be used for each table you create or any table modification you perform. It’s good to keep each migration name descriptive so for example if I was creating a maps table I would name my migration CreateMapsTable. NOTE: CakePHP3 (Phinx) migrations require that you use CamelCase for migration names.

My next post will explain how to create database table migration files with a table example for both up and down methods.

Tags: , , , , ,

No comments yet.

Leave a Reply