-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de94f8c
commit ac9db14
Showing
4 changed files
with
42 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
mongo -u mongo-user -p mongo-pw admin <<EOF | ||
rs.initiate(); | ||
use config; | ||
db.createRole({ role: "dbz-role", privileges: [{resource: { db: "config", collection: "system.sessions" }, actions: [ "find", "update", "insert", "remove" ]}], roles: [ { role: "dbOwner", db: "config" },{ role: "dbAdmin", db: "config" }, { role: "readWrite", db: "config" }]}); | ||
use admin; | ||
db.createUser({"user" : "dbz-user","pwd": "dbz-pw","roles" : [{ "role" : "root","db" : "admin" },{"role" : "readWrite", "db" : "logistics" }, { "role" : "dbz-role", "db" : "config"}]}); | ||
use logistics; | ||
db.createCollection("orders"); | ||
db.createCollection("shipments"); | ||
EOF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,4 +9,15 @@ psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" -d "$POSTGRES_DB" <<-EOSQL | |
INSERT INTO customers (customer_id, first_name, last_name, email, gender, income, fico) VALUES (1,'Waylen','Tubble','[email protected]','Male',403646, 465); | ||
INSERT INTO customers (customer_id, first_name, last_name, email, gender, income, fico) VALUES (2,'Joell','Wilshin','[email protected]','Female',109825, 705); | ||
INSERT INTO customers (customer_id, first_name, last_name, email, gender, income, fico) VALUES (3,'Ilaire','Latus','[email protected]','Male',407964, 750); | ||
CREATE TABLE users (id TEXT PRIMARY KEY, name TEXT, age INT); | ||
INSERT INTO users (id, name, age) VALUES ('1', 'fred', 34); | ||
INSERT INTO users (id, name, age) VALUES ('2', 'sue', 25); | ||
INSERT INTO users (id, name, age) VALUES ('3', 'bill', 51); | ||
INSERT INTO users (id, name, age) VALUES ('4', 'ramon', 36); | ||
INSERT INTO users (id, name, age) VALUES ('5', 'juan', 28); | ||
INSERT INTO users (id, name, age) VALUES ('6', 'federico', 56); | ||
INSERT INTO users (id, name, age) VALUES ('7', 'luis', 37); | ||
INSERT INTO users (id, name, age) VALUES ('8', 'pedro', 27); | ||
INSERT INTO users (id, name, age) VALUES ('9', 'pablo', 59); | ||
INSERT INTO users (id, name, age) VALUES ('10', 'peter', 59); | ||
EOSQL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters