fix: GoTrue one_time_tokens pre-creation in startup script

- neon-startup.py: pre-creates one_time_tokens table to work around
  GoTrue migration ordering bug
- Postgres podman lock contention resolved via system reset
- Infrastructure recovery documented
This commit is contained in:
allaun 2026-06-30 07:57:46 -05:00
parent 29b0582b12
commit b880a32c83

View file

@ -94,6 +94,9 @@ log(f" ✅ {len(files)} migrations attempted (batched)")
all_versions = "','".join(f.split("_")[0] for f in files)
run(f'{PSQL} -d appflowy -c "INSERT INTO auth.schema_migrations (version) SELECT unnest(array[\'{all_versions}\']) ON CONFLICT DO NOTHING"', timeout=30)
# Pre-create tables that GoTrue migrations fail to create due to ordering bugs
run(f'{PSQL} -d appflowy -c "CREATE TABLE IF NOT EXISTS auth.one_time_tokens (id uuid PRIMARY KEY, user_id uuid, token_type text NOT NULL, token_hash text NOT NULL, expires_at timestamptz NOT NULL, created_at timestamptz NOT NULL DEFAULT now())"', timeout=10)
# Sync to public schema for GoTrue binary
run(f'{PSQL} -d appflowy -c "DROP TABLE IF EXISTS public.schema_migrations; CREATE TABLE public.schema_migrations AS SELECT * FROM auth.schema_migrations"', timeout=10)
log(" Migration tracking synced")