dataset/seed/applicationservice/2022.03.08/postgresql/templates/postgresql.sql
Emmanuel Garette 0bfbf16152 *-server => *
2022-04-08 18:55:38 +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