fix(db): add missing GRANT statements to v9.7 migrations
Migrations 030 (sites), 032 (device_interfaces), 033 (wireless_links), and 034 (sectors) were missing GRANT statements for app_user and poller_user. Without these, fresh deploys crash on site/sector CRUD with permission denied errors. Also added poller_user SELECT grants to migration 035 (site_alert_rules/events). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -74,7 +74,11 @@ def upgrade() -> None:
|
||||
""")
|
||||
)
|
||||
|
||||
# 3. Add nullable sector_id FK column to devices table
|
||||
# 3. Grant app_user and poller_user access
|
||||
conn.execute(sa.text("GRANT SELECT, INSERT, UPDATE, DELETE ON sectors TO app_user"))
|
||||
conn.execute(sa.text("GRANT SELECT ON sectors TO poller_user"))
|
||||
|
||||
# 4. Add nullable sector_id FK column to devices table
|
||||
op.add_column(
|
||||
"devices",
|
||||
sa.Column(
|
||||
|
||||
Reference in New Issue
Block a user