Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions common/src/sql/dbwipe.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,15 @@
* NOTE: the database and user names MUST be kept in sync with the
* initialization code and dbwipe.sql.
*/

/*
* This is silly, but we throw an error if the user was already deleted.
* Create the user so we can always delete it.
*/
CREATE DATABASE IF NOT EXISTS omicron;
CREATE USER IF NOT EXISTS omicron;

ALTER DEFAULT PRIVILEGES FOR ROLE root REVOKE ALL ON TABLES FROM omicron;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this is run by the same user that ran dbinit, I think the FOR ROLE root is unnecessary. I mention this because it will be wrong if dbinit wasn't run under that role. I think we could also use FOR ALL ROLES.


DROP DATABASE IF EXISTS omicron;
DROP USER IF EXISTS omicron;