S
S
Sergey Beloventsev2017-09-27 17:02:25
Yii
Sergey Beloventsev, 2017-09-27 17:02:25

Why are all migrations applied?

trying to apply specific migration like this

php yii migrate/to m170927_133748_add_user_bonus_from_user.php

I get this in response
Yii Migration Tool (based on Yii v2.0.11.2)

Total 2 new migrations to be applied:
        m170918_210855_add_mounth_bonus_column_to_user_bonus_item_table
        m170927_133748_add_user_bonus_from_user

Apply the above migrations? (yes|no) [no]:

the first migration is added to the migration table;

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2017-09-27
@Sergalas

Reading the docs:
Which approximately means:
if there was something there before, we will definitely apply it too
. So answering your question "Why are all migrations applied", I answer:
not all, but not applied, and only those up to the one you specified. And because it's meant to be.
So either it was necessary to spread them:
www.yiiframework.com/doc-2.0/guide-db-migrations.h...
Or manipulate the history by changing the timestamp to between them:
www.yiiframework.com/doc-2.0 /guide-db-migrations.h...

M
Maxim Fedorov, 2017-09-27
@Maksclub

php yii migrate/to m170927_133748

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question