Fix: create tracksolid schema before schema_migrations table
On a fresh database the tracksolid schema doesn't exist yet — migration 02 creates it, but ensure_tracking_table() ran first. Added CREATE SCHEMA IF NOT EXISTS tracksolid before the table DDL. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
aa290151ea
commit
63e555b822
1 changed files with 4 additions and 1 deletions
|
|
@ -54,8 +54,11 @@ def get_conn():
|
||||||
|
|
||||||
|
|
||||||
def ensure_tracking_table(conn):
|
def ensure_tracking_table(conn):
|
||||||
"""Create schema_migrations tracking table if it doesn't exist."""
|
"""Create schema and schema_migrations tracking table if they don't exist."""
|
||||||
with conn.cursor() as cur:
|
with conn.cursor() as cur:
|
||||||
|
# Schema may not exist yet on a fresh DB (migration 02 creates it,
|
||||||
|
# but we need it before we can create the tracking table).
|
||||||
|
cur.execute("CREATE SCHEMA IF NOT EXISTS tracksolid")
|
||||||
cur.execute("""
|
cur.execute("""
|
||||||
CREATE TABLE IF NOT EXISTS tracksolid.schema_migrations (
|
CREATE TABLE IF NOT EXISTS tracksolid.schema_migrations (
|
||||||
filename TEXT PRIMARY KEY,
|
filename TEXT PRIMARY KEY,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue