-
-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: add migration for ProjectRole db enum type
- Loading branch information
1 parent
293d25c
commit 15191dc
Showing
2 changed files
with
31 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
-- ## Migration to: | ||
-- * Add public.projectrol enum. | ||
-- * Update the user_roles table to use the enum | ||
|
||
-- Start a transaction | ||
BEGIN; | ||
|
||
CREATE TYPE public.projectrole as ENUM ( | ||
'MAPPER', | ||
'VALIDATOR', | ||
'FIELD_MANAGER', | ||
'ASSOCIATE_PROJECT_MANAGER', | ||
'PROJECT_MANAGER', | ||
'ORGANIZATION_ADMIN' | ||
); | ||
ALTER TYPE public.projectrole OWNER TO fmtm; | ||
ALTER TABLE public.user_roles ALTER COLUMN "role" TYPE public.projectrole; | ||
|
||
-- Commit the transaction | ||
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,11 @@ | ||
-- Start a transaction | ||
BEGIN; | ||
|
||
-- Revert user_roles table changes | ||
ALTER TABLE public.user_roles ALTER COLUMN "role" TYPE public.userrole; | ||
|
||
-- Drop the public.projectrole enum | ||
DROP TYPE IF EXISTS public.projectrole; | ||
|
||
-- Commit the transaction | ||
COMMIT; |