Yii2 Database Migration

I already created and imported my database schema on phpmyadmin, then after installing Yii2 Advanced App I’ve tried migrating and it says “user table already exists”. Is it really necessary to use migrate database or not?

No, it is not neccessary if all tables and columns are already there.

If you want to run the migration but don´t want to get that error you could check if the table is already there and skip the createtable in Up():


if ($this->db->schema->getTableSchema('{{%nameofthetable}}', true) = null) {  // if table does not exist...