Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#4247 - Create Application Versioning (Part 2) #4326

Merged
merged 2 commits into from
Feb 6, 2025
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,16 @@ ADD

COMMENT ON COLUMN sims.applications.preceding_application_id IS 'The immediate previous application from which the current application was created.';

-- Set parent-application-id and preceding-application-id for non-draft applications when application number is present.
-- Create indexes for parent-application-id and preceding-application-id to improve the performance of data retrieval.
CREATE INDEX preceding_application_id_idx ON sims.applications (preceding_application_id);

COMMENT ON INDEX sims.preceding_application_id_idx IS 'Index created on preceding_application_id to improve the performance of data retrieval.';

CREATE INDEX parent_application_id_idx ON sims.applications (parent_application_id);

COMMENT ON INDEX sims.parent_application_id_idx IS 'Index created on parent_application_id to improve the performance of data retrieval.';

-- Set parent-application-id for applications when application number is present.
UPDATE
sims.applications
SET
Expand All @@ -27,7 +36,15 @@ SET
applications.submitted_date
LIMIT
1
), preceding_application_id = COALESCE(
)
WHERE
application_number IS NOT NULL;

-- Set preceding-application-id for applications when application number is present.
UPDATE
sims.applications
SET
preceding_application_id = COALESCE(
(
SELECT
id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
DROP INDEX sims.parent_application_id_idx,
sims.preceding_application_id_idx;

ALTER TABLE
sims.applications DROP CONSTRAINT parent_application_id_constraint,
DROP CONSTRAINT preceding_application_id_constraint;
Expand Down
Loading