REVOKE CREATE ON SCHEMA public FROM PUBLIC;

CREATE ROLE ariadne_migrator
    LOGIN
    PASSWORD 'ariadne_migrator'
    NOSUPERUSER
    NOCREATEDB
    NOCREATEROLE
    NOINHERIT
    NOREPLICATION
    BYPASSRLS;

CREATE ROLE ariadne_runtime
    LOGIN
    PASSWORD 'ariadne_runtime'
    NOSUPERUSER
    NOCREATEDB
    NOCREATEROLE
    NOINHERIT
    NOREPLICATION
    NOBYPASSRLS;

CREATE ROLE ariadne_identity
    LOGIN
    PASSWORD 'ariadne_identity'
    NOSUPERUSER
    NOCREATEDB
    NOCREATEROLE
    NOINHERIT
    NOREPLICATION
    NOBYPASSRLS;

GRANT CONNECT ON DATABASE ariadne
    TO ariadne_migrator, ariadne_runtime, ariadne_identity;
GRANT USAGE, CREATE ON SCHEMA public TO ariadne_migrator;
GRANT USAGE ON SCHEMA public TO ariadne_runtime, ariadne_identity;
