-
-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: mapper frontend task display and event POSTs (#1842)
* build: add primary key constraint on odk_entities.entity_id * feat: working update of entity statuses in fmtm db * docs: comment during proj create * fix: task display and event creation in mapper frontend * build: use correct port mapping for electric
- Loading branch information
1 parent
b8887b3
commit 8db0a04
Showing
15 changed files
with
256 additions
and
102 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-- ## Migration to: | ||
-- * Add a new table that syncs the ODK Entity status to FMTM. | ||
-- * Add a primary key for entity_id field. | ||
-- * Add two indexes on entity_id + project_id / task_id | ||
|
||
|
||
-- Start a transaction | ||
BEGIN; | ||
|
||
CREATE TABLE IF NOT EXISTS public.odk_entities ( | ||
entity_id UUID NOT NULL, | ||
status entitystate NOT NULL, | ||
project_id integer NOT NULL, | ||
task_id integer | ||
); | ||
ALTER TABLE public.odk_entities OWNER TO fmtm; | ||
|
||
DO $$ | ||
BEGIN | ||
IF NOT EXISTS (SELECT 1 FROM pg_constraint WHERE conname = 'odk_entities_pkey') THEN | ||
ALTER TABLE ONLY public.odk_entities | ||
ADD CONSTRAINT odk_entities_pkey PRIMARY KEY (entity_id); | ||
END IF; | ||
END $$; | ||
|
||
CREATE INDEX IF NOT EXISTS idx_entities_project_id | ||
ON public.odk_entities USING btree ( | ||
entity_id, project_id | ||
); | ||
CREATE INDEX IF NOT EXISTS idx_entities_task_id | ||
ON public.odk_entities USING btree ( | ||
entity_id, task_id | ||
); | ||
|
||
-- 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
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.