-
-
Notifications
You must be signed in to change notification settings - Fork 286
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1020 from metabrainz/administration-system
GSoC 2023 - Administration system - Rollup PR
- Loading branch information
Showing
86 changed files
with
5,206 additions
and
240 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,6 @@ | ||
BEGIN TRANSACTION; | ||
|
||
DROP TABLE IF EXISTS bookbrainz.admin_log; | ||
DROP TYPE IF EXISTS bookbrainz.admin_action_type; | ||
|
||
COMMIT; |
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,25 @@ | ||
BEGIN TRANSACTION; | ||
|
||
CREATE TYPE bookbrainz.admin_action_type AS ENUM ( | ||
'Change Privileges' | ||
); | ||
|
||
COMMIT; | ||
|
||
BEGIN TRANSACTION; | ||
|
||
CREATE TABLE bookbrainz.admin_log ( | ||
id SERIAL PRIMARY KEY, | ||
admin_id INT NOT NULL, | ||
target_user_id INT NOT NULL, | ||
old_privs INT, | ||
new_privs INT, | ||
action_type bookbrainz.admin_action_type NOT NULL, | ||
time TIMESTAMP WITHOUT TIME ZONE NOT NULL DEFAULT timezone('UTC'::TEXT, now()), | ||
note VARCHAR NOT NULL | ||
); | ||
|
||
ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (admin_id) REFERENCES bookbrainz.editor(id); | ||
ALTER TABLE bookbrainz.admin_log ADD FOREIGN KEY (target_user_id) REFERENCES bookbrainz.editor(id); | ||
|
||
COMMIT; |
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,5 @@ | ||
BEGIN TRANSACTION; | ||
|
||
ALTER TABLE bookbrainz.editor ADD COLUMN privs INT NOT NULL DEFAULT 1; | ||
|
||
COMMIT; |
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,3 @@ | ||
BEGIN TRANSACTION; | ||
SELECT SETVAL('identifier_type_id_seq', (SELECT MAX(id) FROM identifier_type)); | ||
COMMIT; |
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
Oops, something went wrong.