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

console\controllers\BaseMigrateController actionNew()

actionNew() public method Displays the un-applied new migrations. This command will show the new migrations that have not been applied. For example, yii migrate/new # showing the first 10 new migrations yii migrate/new 5 # showing the first 5 new migrations yii migrate/new all # showing all new migrations public void actionNew ( $limit = 10 )$limit integer The maximum number of new migrations to be displayed. If it is all, all available new migrations will be displayed. throws yi

console\controllers\BaseMigrateController actionMark()

actionMark() public method Modifies the migration history to the specified version. No actual migration will be performed. yii migrate/mark 101129_185401 # using timestamp yii migrate/mark m101129_185401_create_user_table # using full name yii migrate/to app\migrations\M101129185401CreateUser # using full namespace name public integer actionMark ( $version )$version string The version at which the migration history should be marked. This can be either the time

console\controllers\BaseMigrateController actionHistory()

actionHistory() public method Displays the migration history. This command will show the list of migrations that have been applied so far. For example, yii migrate/history # showing the last 10 migrations yii migrate/history 5 # showing the last 5 migrations yii migrate/history all # showing the whole history public void actionHistory ( $limit = 10 )$limit integer The maximum number of migrations to be displayed. If it is "all", the whole migration history will be displayed. thro

console\controllers\BaseMigrateController actionDown()

actionDown() public method Downgrades the application by reverting old migrations. For example, yii migrate/down # revert the last migration yii migrate/down 3 # revert the last 3 migrations yii migrate/down all # revert all migrations public integer actionDown ( $limit = 1 )$limit integer The number of migrations to be reverted. Defaults to 1, meaning the last applied migration will be reverted. return integer The status of the action execution. 0 means normal, other values mea

console\controllers\BaseMigrateController actionCreate()

actionCreate() public method Creates a new migration. This command creates a new migration using the available migration template. After using this command, developers should modify the created migration skeleton by filling up the actual migration logic. yii migrate/create create_user_table In order to generate a namespaced migration, you should specify a namespace before the migration's name. Note that backslash (\) is usually considered a special character in the shell, so you need to es

console\controllers\BaseMigrateController $templateFile

$templateFile public property The template file for generating new migrations. This can be either a path alias (e.g. "@app/migrations/template.php") or a file path. public string $templateFile = null

console\controllers\BaseMigrateController $migrationPath

$migrationPath public property The directory containing the migration classes. This can be either a path alias or a directory path. If you have set up $migrationNamespaces, you may set this field to null in order to disable usage of migrations that are not namespaced. public string $migrationPath = '@app/migrations'

console\controllers\BaseMigrateController $migrationNamespaces

$migrationNamespaces public property (available since version 2.0.10) List of namespaces containing the migration classes. Migration namespaces should be resolvable as a path alias if prefixed with @, e.g. if you specify the namespace app\migrations, the code Yii::getAlias('@app/migrations') should be able to return the file path to the directory this namespace refers to. For example: [ 'app\migrations', 'some\extension\migrations', ] public array $migrationNamespaces = []

console\controllers\BaseMigrateController $defaultAction

$defaultAction public property The default command action. public string $defaultAction = 'up'