fix: auto-apply feature fixes migration on startup
This commit is contained in:
parent
cbad50a987
commit
cd4d9124b0
|
|
@ -83,6 +83,26 @@ def apply_migration():
|
||||||
|
|
||||||
print("[v9c Migration] ✅ Migration completed successfully!")
|
print("[v9c Migration] ✅ Migration completed successfully!")
|
||||||
|
|
||||||
|
# Apply fix migration if exists
|
||||||
|
fix_migration_path = os.path.join(
|
||||||
|
os.path.dirname(__file__),
|
||||||
|
"migrations",
|
||||||
|
"v9c_fix_features.sql"
|
||||||
|
)
|
||||||
|
|
||||||
|
if os.path.exists(fix_migration_path):
|
||||||
|
print("[v9c Migration] Applying feature fixes...")
|
||||||
|
with open(fix_migration_path, 'r', encoding='utf-8') as f:
|
||||||
|
fix_sql = f.read()
|
||||||
|
|
||||||
|
conn = get_db_connection()
|
||||||
|
cur = conn.cursor()
|
||||||
|
cur.execute(fix_sql)
|
||||||
|
conn.commit()
|
||||||
|
cur.close()
|
||||||
|
conn.close()
|
||||||
|
print("[v9c Migration] ✅ Feature fixes applied!")
|
||||||
|
|
||||||
# Verify tables created
|
# Verify tables created
|
||||||
conn = get_db_connection()
|
conn = get_db_connection()
|
||||||
cur = conn.cursor()
|
cur = conn.cursor()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user