top | item 39629180

(no title)

konha | 2 years ago

> How do they merge?

Manually. When you merge your code back into a common branch you look at the existing migrations and the new migrations and make sure the numbers make sense (after the merge). You can avoid stepping on each other’s toes by using a timestamp for the number in your filename. You still have to make sure (when you merge) the order makes sense.

> How does the migration tool know which migration to apply first?

Migrations are ordered by the (ascending) number in the filename. (Or some other scheme, but this is common)

> But having to check the latest migration and check that with my local db seems a little bit error-prone and cumbersome, no?

The number in the database should never be higher than the highest numbered file in source control. So you can increment without looking.

discuss

order

No comments yet.