#!/bin/bash
set -e
echo "Applying Migration 012: Notfallplan..."
/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/012_notfallplan.sql') as f:
    cur.execute(f.read())
conn.commit()
cur.close()
conn.close()
print('Migration 012 applied successfully')
"
echo "Done."
