-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[postgres] give ingest access to the encryption_keys table
- Loading branch information
Showing
3 changed files
with
24 additions
and
1 deletion.
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,21 @@ | ||
|
||
DO | ||
$$ | ||
DECLARE | ||
-- The version we know how to do migration from, at the end of a successful migration | ||
-- we will no longer be at this version. | ||
sourcever INTEGER := 15; | ||
changes VARCHAR := 'Give ingest user select priviledge in encryption_keys table'; | ||
BEGIN | ||
IF (select max(version) from sda.dbschema_version) = sourcever then | ||
RAISE NOTICE 'Doing migration from schema version % to %', sourcever, sourcever+1; | ||
RAISE NOTICE 'Changes: %', changes; | ||
INSERT INTO sda.dbschema_version VALUES(sourcever+1, now(), changes); | ||
|
||
GRANT SELECT ON sda.encryption_keys TO ingest; | ||
|
||
ELSE | ||
RAISE NOTICE 'Schema migration from % to % does not apply now, skipping', sourcever, sourcever+1; | ||
END IF; | ||
END | ||
$$ |