-- Create OPC database if it doesn't exist
SELECT 'CREATE DATABASE opc'
WHERE NOT EXISTS (SELECT FROM pg_database WHERE datname = 'opc')\gexec

-- Grant permissions to gitea user
GRANT ALL PRIVILEGES ON DATABASE opc TO gitea;
