mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2025-01-18 17:15:13 +01:00
Fix backup migration running twice.
This commit is contained in:
parent
59b9222b78
commit
f3550ca817
@ -8,7 +8,7 @@ import logging
|
|||||||
|
|
||||||
from app.classes.shared.helpers import Helpers
|
from app.classes.shared.helpers import Helpers
|
||||||
from app.classes.shared.console import Console
|
from app.classes.shared.console import Console
|
||||||
from app.classes.shared.migration import Migrator
|
from app.classes.shared.migration import Migrator, MigrateHistory
|
||||||
from app.classes.shared.file_helpers import FileHelpers
|
from app.classes.shared.file_helpers import FileHelpers
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
@ -25,6 +25,12 @@ def migrate(migrator: Migrator, database, **kwargs):
|
|||||||
"""
|
"""
|
||||||
Write your migrations here.
|
Write your migrations here.
|
||||||
"""
|
"""
|
||||||
|
this_migration = MigrateHistory.get_or_none(
|
||||||
|
MigrateHistory.name == "20240308_multi-backup"
|
||||||
|
)
|
||||||
|
if this_migration is not None:
|
||||||
|
Console.debug("Update database already done, skipping this part")
|
||||||
|
return
|
||||||
backup_migration_status = True
|
backup_migration_status = True
|
||||||
schedule_migration_status = True
|
schedule_migration_status = True
|
||||||
db = database
|
db = database
|
||||||
|
Loading…
x
Reference in New Issue
Block a user