Yii 2 Migration Creator And Updater
Code cleaning and removing unnecessary docs,
Added new action sql
allowing to extract SQL statements from the given migration file. Usage examples:
yii migration/sql migration_name
yii migration/sql migration_name up
yii migration/sql migration_name down
safeUp()
instead of up()
and safeDown()
instead of down()
in the migration template to match changes in default Yii behavior.Thank you, @naduvko for reporting these.
_n_
stamp (when n
is the number of the next migration) anymore. Instead they are saved with just the timestamp that is not repeated for other migrations in the batch. Thanks to that it is safe to run migrate/mark
, migrate/to
, and similar Yii commands with such migrations. In case there are possible timestamp collisions with existing migrations user will get a warning first.leeway
(lw
) option to add seconds to the starting timestamp for migrations generation.Many thanks to @karolls for reporting these cases.
fileMode
option to set the file permissions for generated migrations (int|string|null
, default null
, expects integer value like 0777
or integerish string convertable to integer).fileOwnership
option to set the file ownership for generated migrations (string|int|array<int|string, int|string>|null
, default null
, can be integer user id, string user name, string user:group combination, string user: or :group only, or array with [user, group] or ['user' => user, 'group' => group] data).FileHelper::changeOwnership()
or the internal fallback in case of older Yii versions.Ensured MySQL 8 compatibility.
Fixed bug with handling renamed table migration.
v4 suggested.
v4 suggested.