ЛР7 - БВТ2302 - Зюлина - на 3
Skeleton contracts / contracts (pull_request) Blocked by required conditions

This commit is contained in:
2026-11-29 12:55:09 +03:00
parent 20afc2c790
commit 5b8c2a22e1
54 changed files with 2781 additions and 94 deletions
+12
View File
@@ -0,0 +1,12 @@
"""Apply worker's narrow table grant after migrations have created attachments."""
import os
import psycopg2
conn = psycopg2.connect(os.environ["DATABASE_URL"], sslmode="verify-full",
sslrootcert=os.getenv("DB_CA_FILE", "/run/tls/service-ca.crt"))
try:
with conn:
with conn.cursor() as cur:
cur.execute("GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE attachments TO messenger_worker")
finally:
conn.close()