fix(ci): fix hardcoded DB name in migration and Go version compat

- migration 002: use current_database() instead of hardcoded 'tod'
- ci.yml: use Go 1.25 (required by nats-server dep), mark golangci-lint
  as continue-on-error until it supports Go 1.25
- go.mod: keep at 1.25.0 (nats-server v2.12.5 requires it)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jason Staack
2026-03-14 23:03:20 -05:00
parent ac2a09e2bd
commit fe23459369
4 changed files with 7 additions and 14 deletions

View File

@@ -58,7 +58,9 @@ def upgrade() -> None:
""")
)
conn.execute(sa.text("GRANT CONNECT ON DATABASE tod TO poller_user"))
# Get current database name dynamically (avoids hardcoding 'tod')
db_name = conn.execute(sa.text("SELECT current_database()")).scalar()
conn.execute(sa.text(f'GRANT CONNECT ON DATABASE "{db_name}" TO poller_user'))
conn.execute(sa.text("GRANT USAGE ON SCHEMA public TO poller_user"))
# SELECT on devices only — poller needs to read encrypted_credentials
@@ -81,7 +83,8 @@ def downgrade() -> None:
pass
try:
conn.execute(sa.text("REVOKE CONNECT ON DATABASE tod FROM poller_user"))
db_name = conn.execute(sa.text("SELECT current_database()")).scalar()
conn.execute(sa.text(f'REVOKE CONNECT ON DATABASE "{db_name}" FROM poller_user'))
except Exception:
pass