mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
Propagate changes to _skip_all_migrations
This commit is contained in:
parent
dedc85e52a
commit
74b5ea5982
1 changed files with 5 additions and 12 deletions
|
@ -1298,18 +1298,11 @@ def _skip_all_migrations():
|
|||
This is meant to be used during postinstall to
|
||||
initialize the migration system.
|
||||
"""
|
||||
state = tools_migrations_state()
|
||||
|
||||
# load all migrations
|
||||
migrations = _get_migrations_list()
|
||||
migrations = sorted(migrations, key=lambda x: x.number)
|
||||
last_migration = migrations[-1]
|
||||
|
||||
state["last_run_migration"] = {
|
||||
"number": last_migration.number,
|
||||
"name": last_migration.name
|
||||
}
|
||||
write_to_json(MIGRATIONS_STATE_PATH, state)
|
||||
all_migrations = _get_migrations_list()
|
||||
new_states = {"migrations": {}}
|
||||
for migration in all_migrations:
|
||||
new_states["migrations"][migration.id] = "skipped"
|
||||
write_to_yaml(MIGRATIONS_STATE_PATH, new_states)
|
||||
|
||||
|
||||
class Migration(object):
|
||||
|
|
Loading…
Add table
Reference in a new issue