dataset/seed/postgresql/templates/postgresql.sql
2022-07-01 22:10:33 +02:00

7 lines
362 B
SQL

%for %%server in %%accounts.remotes
%set %%name = %%normalize_family(%%server)
CREATE DATABASE "%%name";
CREATE ROLE "%%name" WITH LOGIN ENCRYPTED PASSWORD '%%accounts["remote_" + %%name]["password_" + %%name]';
ALTER USER "%%name" PASSWORD '%%accounts["remote_" + %%name]["password_" + %%name]';
GRANT ALL PRIVILEGES ON DATABASE "%%name" TO "%%name";
%end for