ЛР7 - БВТ2302 - Зюлина - на 3
Skeleton contracts / contracts (pull_request) Blocked by required conditions
Skeleton contracts / contracts (pull_request) Blocked by required conditions
This commit is contained in:
@@ -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()
|
||||
Reference in New Issue
Block a user