G
G
gto61202017-01-20 08:55:04
git
gto6120, 2017-01-20 08:55:04

VCS and Yii2 migrations, how to rollback?

I'm interested in the situation when you return to previous commits and want to bring the database into line with the state of the code that is in this commit. So far, I see only the option to delete all migrations from the table in the database and then do yii migrate (that is, apply all migrations from scratch). The option has a drawback: with a large number of migrations, and if they also include initial data, there will be a long execution time.
Who decides such questions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Fedorov, 2017-01-20
@gto6120

1. We roll back the migration to the one we need using migrate / to
2. We roll back to the required version of the sources

A
aol-nnov, 2017-01-20
@aol-nnov

I should consult documentation more often :)
inb4: rolled back migrations, rolled back code.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question