Replay out of sequence migrations #50

Closed
opened 2020-03-31 11:07:53 +00:00 by jamie · 4 comments
jamie commented 2020-03-31 11:07:53 +00:00 (Migrated from git.hazaar.io)

Now that the schema file is a thing of the past, we should be able to reply migration files out of sequence. This DOES NOT mean out of order.

Basically, the thing this is trying to fix is if your schema is in some sort of version control, such as git, and developers create migration files in two separate branches. As long as there are no collisions or conflicts, this should be perfectly OK to do. What we will be able to do here is scan the schema_info table and find out which migrations are missing and replay them individually. This means that if a migration gets missed, for example because it's version is earlier than a migration from another branch but that branch is merged into a master branch first, we will be able to reply it and catch up.

The caveat here is that if a snapshot is being created, the database still has to be in the last known latest version. There may also be problems if migrations refer to the same elements, but even this will be fairly fault tollerant.

Now that the schema file is a thing of the past, we should be able to reply migration files out of sequence. This DOES NOT mean out of order. Basically, the thing this is trying to fix is if your schema is in some sort of version control, such as git, and developers create migration files in two separate branches. As long as there are no collisions or conflicts, this should be perfectly OK to do. What we will be able to do here is scan the schema_info table and find out which migrations are missing and replay them individually. This means that if a migration gets missed, for example because it's version is earlier than a migration from another branch but that branch is merged into a master branch first, we will be able to reply it and catch up. The caveat here is that if a snapshot is being created, the database still has to be in the last known latest version. There may also be problems if migrations refer to the same elements, but even this will be fairly fault tollerant.
jamie commented 2020-03-31 11:07:58 +00:00 (Migrated from git.hazaar.io)

mentioned in merge request !22

mentioned in merge request !22
jamie commented 2020-03-31 11:07:58 +00:00 (Migrated from git.hazaar.io)

created merge request !22 to address this issue

created merge request !22 to address this issue
jamie commented 2020-03-31 12:57:48 +00:00 (Migrated from git.hazaar.io)

closed via merge request !22

closed via merge request !22
jamie commented 2020-03-31 12:57:48 +00:00 (Migrated from git.hazaar.io)

mentioned in commit 04ebecf1eb

mentioned in commit 04ebecf1eb5873f74255505974c47ae47c966083
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: hazaar/hazaar-dbi#50
No description provided.