-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
db: created additional files and changed users
- Loading branch information
Showing
4 changed files
with
46 additions
and
37 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
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,23 @@ | ||
INSERT INTO "participant" ("id", "event_id", "user_id", "status_id") VALUES | ||
(1, 1, 1, 1), | ||
(2, 2, 2, 2); | ||
|
||
INSERT INTO "parameter" ("id", "key", "value") VALUES | ||
(1, 'Location', 'Virtual'), | ||
(2, 'SpeakerCount', '5'); | ||
|
||
INSERT INTO "event_parameter" ("parameter_id", "event_id") VALUES | ||
(1, 1), | ||
(2, 2); | ||
|
||
INSERT INTO "comment" ("id", "event_id", "content", "created_at", "user_id") VALUES | ||
(1, 1, 'Looking forward to this!', '2023-09-10', 1), | ||
(2, 2, 'Cant wait to attend!', '2023-10-15', 2); | ||
|
||
INSERT INTO "interest" ("id", "name", "level") VALUES | ||
(1, 'Programming', 5), | ||
(2, 'Reading', 4); | ||
|
||
INSERT INTO "user_interest" ("user_id", "interest_id") VALUES | ||
(1, 1), | ||
(2, 2); |
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,15 @@ | ||
CREATE ROLE admindb WITH LOGIN PASSWORD 'admin_password'; | ||
|
||
GRANT CONNECT ON DATABASE reasn TO admindb; | ||
GRANT USAGE ON SCHEMA public TO admindb; | ||
GRANT INSERT, SELECT, UPDATE, DELETE ON ALL TABLES IN SCHEMA public TO admindb; | ||
REVOKE ALL ON event_parameter, event_tag, user_interest FROM admindb; | ||
|
||
|
||
CREATE ROLE userdb WITH LOGIN PASSWORD 'user_password'; | ||
|
||
GRANT CONNECT ON DATABASE reasn TO userdb; | ||
GRANT SELECT ON ALL TABLES IN SCHEMA public TO userdb; | ||
GRANT SELECT, UPDATE, INSERT, DELETE ON comment, event, address, interest TO userdb; | ||
GRANT SELECT, UPDATE, INSERT ("name", surname, username, "password", email, phone) ON "user" TO userdb | ||
|