-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: replace project.private field with project.visibility enum (#1132
) * build: remove project_allowed_users table from db * build: remove odk_central_src field from project table * refactor: tidy/reorder project db model fields * build: remove project.task_creation_mode field + enum * build: replace project.private field with project.visibility enum * fix: fix visibility migration column add syntax * fix: apply migration to projects table * build: fix check for projectvisibility type in migration * ci: update workflows 1.4.5 for mkdocs --dirty
- Loading branch information
1 parent
17ae34d
commit 0925773
Showing
15 changed files
with
96 additions
and
94 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
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
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
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
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 |
---|---|---|
@@ -1,14 +1,37 @@ | ||
-- ## Migration to: | ||
-- * Add odk central credentials (str) to organisations table. | ||
-- * Add the approved (bool) field to organisations table. | ||
-- * Add the visibility type for project visibility level. | ||
-- * Add the visibility field to projects table. | ||
|
||
-- Start a transaction | ||
BEGIN; | ||
|
||
-- Add fields to organisations table | ||
ALTER TABLE IF EXISTS public.organisations | ||
ADD COLUMN IF NOT EXISTS approved BOOLEAN DEFAULT false, | ||
ADD COLUMN IF NOT EXISTS odk_central_url VARCHAR, | ||
ADD COLUMN IF NOT EXISTS odk_central_user VARCHAR, | ||
ADD COLUMN IF NOT EXISTS odk_central_password VARCHAR; | ||
|
||
-- Create visibility enum if it doesn't exist | ||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM pg_type WHERE typname = 'projectvisibility') THEN | ||
CREATE TYPE public.projectvisibility AS ENUM ( | ||
'PUBLIC', | ||
'PRIVATE', | ||
'INVITE_ONLY' | ||
); | ||
END IF; | ||
END $$; | ||
ALTER TYPE public.projectvisibility OWNER TO fmtm; | ||
|
||
-- Add field to projects table | ||
ALTER TABLE IF EXISTS public.projects | ||
DROP COLUMN IF EXISTS private, | ||
ADD COLUMN IF NOT EXISTS visibility public.projectvisibility | ||
NOT NULL DEFAULT 'PUBLIC'; | ||
|
||
-- Commit the transaction | ||
COMMIT; |
Oops, something went wrong.