forked from lorint/AdventureWorks-for-Postgres
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.sh
33 lines (32 loc) · 1.28 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/bin/bash
export PGUSER=postgres
psql <<- SHELL
CREATE DATABASE "Adventureworks";
SHELL
cd /data
psql -d Adventureworks < /data/install.sql
psql -d Adventureworks <<- EOF
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
CREATE USER docker WITH PASSWORD 'docker';
GRANT CONNECT ON DATABASE "Adventureworks" TO docker;
GRANT USAGE ON SCHEMA hr TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA hr TO docker;
GRANT USAGE ON SCHEMA humanresources TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA humanresources TO docker;
GRANT USAGE ON SCHEMA pe TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA pe TO docker;
GRANT USAGE ON SCHEMA person TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA person TO docker;
GRANT USAGE ON SCHEMA pr TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA pr TO docker;
GRANT USAGE ON SCHEMA production TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA production TO docker;
GRANT USAGE ON SCHEMA pu TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA pu TO docker;
GRANT USAGE ON SCHEMA purchasing TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA purchasing TO docker;
GRANT USAGE ON SCHEMA sa TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA sa TO docker;
GRANT USAGE ON SCHEMA sales TO docker;
GRANT SELECT ON ALL TABLES IN SCHEMA sales TO docker;
EOF