console\controllers\BaseMigrateController getNewMigrations()

getNewMigrations() protected method Returns the migrations that are not applied. protected array getNewMigrations ( )return array List of new migrations

console\controllers\BaseMigrateController migrateToVersion()

migrateToVersion() protected method Migrates to the certain version. protected integer migrateToVersion ( $version )$version string Name in the full format. return integer CLI exit code throws yii\console\Exception if the provided version cannot be found.

console\controllers\BaseMigrateController getMigrationHistory()

getMigrationHistory() protected abstract method Returns the migration history. protected abstract array getMigrationHistory ( $limit )$limit integer The maximum number of records in the history to be returned. null for "no limit". return array The migration history

console\controllers\BaseMigrateController migrateDown()

migrateDown() protected method Downgrades with the specified migration class. protected boolean migrateDown ( $class )$class string The migration class name return boolean Whether the migration is successful

console\controllers\BaseMigrateController beforeAction()

beforeAction() public method This method is invoked right before an action is to be executed (after all possible filters.) It checks the existence of the $migrationPath. public boolean beforeAction ( $action )$action yii\base\Action The action to be executed. return boolean Whether the action should continue to be executed. throws yii\base\InvalidConfigException if directory specified in migrationPath doesn't exist and action isn't "create".

console\controllers\BaseMigrateController createMigration()

createMigration() protected method Creates a new migration instance. protected yii\db\MigrationInterface createMigration ( $class )$class string The migration class name return yii\db\MigrationInterface The migration instance

console\controllers\BaseMigrateController generateMigrationSourceCode()

generateMigrationSourceCode() protected method (available since version 2.0.8) Generates new migration source PHP code. Child class may override this method, adding extra logic or variation to the process. protected string generateMigrationSourceCode ( $params )$params array Generation parameters, usually following parameters are present: name: string migration base name className: string migration class name return string Generated PHP code.

console\controllers\BaseMigrateController actionUp()

actionUp() public method Upgrades the application by applying new migrations. For example, yii migrate # apply all new migrations yii migrate 3 # apply the first 3 new migrations public integer actionUp ( $limit = 0 )$limit integer The number of new migrations to be applied. If 0, it means applying all available new migrations. return integer The status of the action execution. 0 means normal, other values mean abnormal.

console\controllers\BaseMigrateController addMigrationHistory()

addMigrationHistory() protected abstract method Adds new migration entry to the history. protected abstract void addMigrationHistory ( $version )$version string Migration version name.

console\controllers\BaseMigrateController actionRedo()

actionRedo() public method Redoes the last few migrations. This command will first revert the specified migrations, and then apply them again. For example, yii migrate/redo # redo the last applied migration yii migrate/redo 3 # redo the last 3 applied migrations yii migrate/redo all # redo all migrations public integer actionRedo ( $limit = 1 )$limit integer The number of migrations to be redone. Defaults to 1, meaning the last applied migration will be redone. return integer Th