mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Solution is disabling update if already done
This commit is contained in:
parent
c00cb1a61d
commit
8f8feef6de
@ -372,8 +372,10 @@ class MigrationManager(object):
|
||||
Create migrator
|
||||
"""
|
||||
migrator = Migrator(self.database)
|
||||
# Creating false migrations from the
|
||||
for name in self.diff:
|
||||
# Running false migrations to retrives the schemes of
|
||||
# the precedents created tables in the table_dict element
|
||||
# It's useful to run the new migrations
|
||||
for name in self.done:
|
||||
self.up_one(name, migrator, True)
|
||||
return migrator
|
||||
|
||||
|
@ -22,6 +22,13 @@ def migrate(migrator: Migrator, database, **kwargs):
|
||||
"""
|
||||
db = database
|
||||
|
||||
this_migration = MigrateHistory.get(MigrateHistory.name == "20240216_rework_servers_uuid_part2")
|
||||
if this_migration:
|
||||
Console.debug("Update database already done, skipping this migration")
|
||||
return
|
||||
else :
|
||||
Console.debug("Update database not done, doing : Migration Data from Int to UUID")
|
||||
|
||||
# **********************************************************************************
|
||||
# Servers New Model from Old (easier to migrate without dunmping Database)
|
||||
# **********************************************************************************
|
||||
|
Loading…
Reference in New Issue
Block a user