7 lines
362 B
SQL
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
|