[FIXED] Yii2 migrate dump SQL

Issue

Is possible to dump in a file the SQL of the executed migration(s)? (or before executing? like a dry-run)

I took a look into the sources and if I'm not wrong the current implementation doesn't handle it, but probably wouldn't be too complicate to add the option, or I'm missing something?


Solution

It's not easy right now but still possible.

You would have to override yii\db\Command::execute() to return raw SQL instead of executing it.



Answered By - Bizley
Answer Checked By - Mary Flores (sql.easybugfix Volunteer)

Related Posts

Post a Comment