Commit each schema migration separately on PostgreSQL.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -373,11 +373,11 @@ def init_db():
|
||||
for sql in migrations:
|
||||
try:
|
||||
c.execute(sql)
|
||||
conn.commit()
|
||||
except Exception as exc:
|
||||
if not is_schema_migration_error(exc):
|
||||
raise
|
||||
rollback_if_postgres(conn)
|
||||
conn.commit()
|
||||
c.execute('''CREATE TABLE IF NOT EXISTS review_records
|
||||
(id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
open_time TEXT, close_time TEXT,
|
||||
@@ -430,6 +430,7 @@ def init_db():
|
||||
):
|
||||
try:
|
||||
c.execute(sql)
|
||||
conn.commit()
|
||||
except Exception as exc:
|
||||
if not is_schema_migration_error(exc):
|
||||
raise
|
||||
|
||||
Reference in New Issue
Block a user