Fix 502 after update: safe startup, single DB init, healthcheck
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
+6
-5
@@ -319,9 +319,10 @@ def ensure_folder_schema():
|
||||
tables = inspector.get_table_names()
|
||||
|
||||
if "photos" in tables:
|
||||
columns = {col["name"] for col in inspector.get_columns("photos")}
|
||||
if "folder_id" not in columns:
|
||||
db.session.execute(
|
||||
text("ALTER TABLE photos ADD COLUMN folder_id INTEGER REFERENCES folders(id)")
|
||||
db.session.execute(
|
||||
text(
|
||||
"ALTER TABLE photos ADD COLUMN IF NOT EXISTS "
|
||||
"folder_id INTEGER REFERENCES folders(id)"
|
||||
)
|
||||
db.session.commit()
|
||||
)
|
||||
db.session.commit()
|
||||
|
||||
Reference in New Issue
Block a user