yii2 database migration

Hello, I need to migrate a database in yii2. I want to read from MySQL database values for foreign key constraints, on delete cascade, restrict, set null. The same for on update values. Is it some possibilities to do it in migration tool.

no that is not possibl, you probably have to manually declare your schema in a migration file and then run the migration tool.

Not out of the box. There are some extensions for that though.

A MySQL database in Yii1 is the same in Yii2. would need to use Gii (or other generator) the build the models/CRUD from scratch and go from there.

Are you moving the database? You can use phpMyAdmin (or cmd line) and export the database structure and data to an sql file, then import that into the new location. Exporting the structure will keep all of the field, foreign_key cascade actions, etc of the tables.

If you are building an app to be distributed with a Yii migration, then as @samdark said there are extension that can do that, but most of the ones I’ve looked at have limitations. Building you own with yii migrate is not that difficult (unless you have A LOT of tables :) )