zitadel/migrations/cockroach/V1.0__databases.sql

36 lines
1.3 KiB
MySQL
Raw Normal View History

CREATE DATABASE management;
CREATE DATABASE auth;
CREATE DATABASE notification;
CREATE DATABASE adminapi;
CREATE DATABASE authz;
CREATE DATABASE eventstore;
CREATE USER eventstore;
GRANT SELECT, INSERT ON DATABASE eventstore TO eventstore;
CREATE USER management;
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE management TO management;
GRANT SELECT, INSERT ON DATABASE eventstore TO management;
CREATE USER adminapi;
GRANT SELECT, INSERT, UPDATE, DELETE, DROP ON DATABASE adminapi TO adminapi;
GRANT SELECT, INSERT ON DATABASE eventstore TO adminapi;
GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE auth TO adminapi;
GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE authz TO adminapi;
GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE management TO adminapi;
GRANT SELECT, INSERT, UPDATE, DROP, DELETE ON DATABASE notification TO adminapi;
CREATE USER auth;
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE auth TO auth;
GRANT SELECT, INSERT ON DATABASE eventstore TO auth;
CREATE USER notification;
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE notification TO notification;
GRANT SELECT, INSERT ON DATABASE eventstore TO notification;
CREATE USER authz;
GRANT SELECT, INSERT, UPDATE, DELETE ON DATABASE authz TO authz;
GRANT SELECT, INSERT ON DATABASE eventstore TO authz;
GRANT SELECT, INSERT, UPDATE ON DATABASE auth TO authz;