Yii — Convert database to migrations

It happens to be best of us. You start a new Yii project, generate a few
tables and fields, create the models in Gii and totally forget to use
any migrations.

There’s an easy way to move yourself to a db backed migration.

  • Put txDbMigration in your codebase.
  • Create a new seed migration file
  • Update your console config file
  • Only use migrations from now on.