Every repository with this icon (
Every repository with this icon (
Command Line Options
Migrates to the the most recent version (the newest migration file)
cake migrateMigrates to the specified version number.
cake migrate [version]Example: This will migrate up or down to version 2.
cake migrate 2Generates a migration file with the given name migration name. Migration name must be alphanumeric, but can include spaces, hyphens and underscores.
cake migrate generate|gen|g [name?]Example: This will generate a migration file called ‘001_my_first_migration.yml’
cake migrate g my_first_migrationGenerates a migration file for the specified table(s). The YAML is generated from the actual database table. If no tables are passed, it generates one single migration file called full_schema.yml using your current database tables.
cake migrate generate|gen|g from db [table2 …?]Example: This will generate a migration file for each given table name (which must already exist in the DB), and populate the file with the schema found in each table.
cake migrate g from db users groupsExample: This will generate a ‘full_schema.yml’ migration file, containing the schema for all existing tables in your database.
cake migrate g from dbGenerates the cake sessions table.
cake migrate generate|gen|g sessionsGenerates a migration file that will create a table with the given underscored table_name.
cake migrate generate|gen|g create table_nameExample: This will generate a migration file called ‘001_create_users.yml’ and will attempt to build the default YAML to create a table called ‘users’.
cake migrate g create usersRuns and migrates the full_schema.yml migration file if it exists.
cake migrate from_schemaDrops all tables and resets the current version to 0
cake migrate resetMigrates down to 0 and back up o the latest version
cake migrate allMigrates down to the previous current version
cake migrate downMigrates up from the current to the next version
cake migrate upDisplays the Help
cake migrate helpAppend ‘-ds data_source’ to the command if you want to specify the data_source to use from database.php







