Drop NOT NULL sur servers.etat pour accepter les physiques non-lifecycle
This commit is contained in:
parent
a366427daf
commit
9048a87397
@ -78,10 +78,11 @@ def main():
|
||||
print(f"[INFO] DB: {DATABASE_URL.split('@')[-1]}")
|
||||
conn = engine.connect().execution_options(isolation_level="AUTOCOMMIT")
|
||||
|
||||
# 1. Drop CHECK + migrate legacy values
|
||||
print("[INFO] Drop ancien CHECK...")
|
||||
# 1. Drop CHECK + NOT NULL + migrate legacy values
|
||||
print("[INFO] Drop ancien CHECK + NOT NULL...")
|
||||
if not args.dry_run:
|
||||
conn.execute(text("ALTER TABLE servers DROP CONSTRAINT IF EXISTS servers_etat_check"))
|
||||
conn.execute(text("ALTER TABLE servers ALTER COLUMN etat DROP NOT NULL"))
|
||||
|
||||
print("[INFO] Migration valeurs existantes -> lifecycle iTop ou NULL...")
|
||||
for old, new in LEGACY_MAP.items():
|
||||
|
||||
Loading…
Reference in New Issue
Block a user