#!/bin/bash
set -e
echo "Applying Migration 011: Escalations..."
/usr/local/bin/docker exec bp-compliance-backend python3 -c "
import psycopg2, os
conn = psycopg2.connect(os.getenv('DATABASE_URL'))
cur = conn.cursor()
with open('/app/migrations/011_escalations.sql') as f:
    cur.execute(f.read())
conn.commit()
cur.close()
conn.close()
print('Migration 011 applied successfully')
"
echo "Done."
