-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Initialize migration workflow #957
Initialize migration workflow #957
Conversation
50fa7c2
to
c1d3052
Compare
lib/mix/tasks/migrate.ex
Outdated
|
||
migrations_to_run = | ||
if File.exists?(migration_file_path) do | ||
read_file(migration_file_path) |> filter_migrations_to_run(function) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something I don't get but that might not be an issue, if there are 4 migrations to catch up, this will do the 4 pre_start one after the other. Is it ok ? Don't you need to do pre_start1 then pre_up1 then post_up1 and only then run pre_start2 then pre_up2, then post_up2 etc. ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The case here is that the pre_start is triggered when the node start, and the pre/post upgrade are triggered when the node is currently running and doing an hot upgrade.
When a node is currenlty running it means that it is on the last version, or it will integrate new version one by one (with the governance transactions).
So for a specific version you can run either pre_start or pre/post upgrade but never both.
And in theory the code in pre_start would be the same as pre/post upgrade
dabb948
to
c86de31
Compare
Description
This PR aim to initialize the migration workflow.
Each migration needed will be an elixir scripts in
priv/migration_tasks
according the name to[version]-[description].exs
.There is 2 times when the migration is called:
The migration file in DB always contains the last version the node runned the migrate tool, even if there is no migration to execute
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
Checklist: