-- ============================================================
--  Create the n8n database and user on your EXTERNAL PostgreSQL
--  Run this ONCE on the PostgreSQL server as a superuser, e.g.:
--    psql -U postgres -f setup.sql
-- ============================================================

CREATE USER "n8n" WITH PASSWORD 'replace-with-strong-password';
CREATE DATABASE "n8n" OWNER "n8n";
GRANT ALL PRIVILEGES ON DATABASE "n8n" TO "n8n";
GRANT ALL ON SCHEMA public TO "n8n";
