-
Notifications
You must be signed in to change notification settings - Fork 1
/
fix-databases.sh
executable file
·20 lines (19 loc) · 1.13 KB
/
fix-databases.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
psql -v ON_ERROR_STOP=0 --username "homestead" --dbname "postgres" <<-EOSQL
CREATE USER homestead;
ALTER USER homestead PASSWORD 'secret';
CREATE USER homestead_reader;
ALTER USER homestead_reader PASSWORD 'secret';
CREATE DATABASE og_ckan_registry_local__dev;
CREATE DATABASE og_ckan_registry_ds_local__dev;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_local__dev TO homestead;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_ds_local__dev TO homestead;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_local__dev TO homestead_reader;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_ds_local__dev TO homestead_reader;
CREATE DATABASE og_ckan_registry_local__dev__test;
CREATE DATABASE og_ckan_registry_ds_local__dev__test;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_local__dev__test TO homestead;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_ds_local__dev__test TO homestead;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_local__dev__test TO homestead_reader;
GRANT ALL PRIVILEGES ON DATABASE og_ckan_registry_ds_local__dev__test TO homestead_reader;
EOSQL