-
Notifications
You must be signed in to change notification settings - Fork 14
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 1) #4314
Conversation
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Show resolved
Hide resolved
Please have a look at the comments @sh16011993 |
- Added the DB migration to have the new columns populated.
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Show resolved
Hide resolved
ADD | ||
CONSTRAINT parent_application_id_contraint CHECK( | ||
parent_application_id IS NOT NULL | ||
OR application_status IN ('Draft', 'Cancelled') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As per our discussion, the NOT NULL is allowed only for draft status.
ALTER TABLE
sims.applications
ADD
CONSTRAINT parent_application_id_constraint CHECK(
parent_application_id IS NOT NULL
OR application_status = 'Draft'
),
ADD
CONSTRAINT preceding_application_id_constraint CHECK(
preceding_application_id IS NOT NULL
OR application_status = 'Draft'
);
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
.../backend/apps/db-migrations/src/sql/Applications/Drop-add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
.../backend/apps/db-migrations/src/sql/Applications/Drop-add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/services/application/application.service.ts
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/services/application/application.service.ts
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
...kages/backend/apps/db-migrations/src/sql/Applications/Add-application-versioning-columns.sql
Outdated
Show resolved
Hide resolved
sources/packages/backend/apps/api/src/services/application/application.service.ts
Outdated
Show resolved
Hide resolved
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for making the changes. Looks good 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Nice work
As a part of this PR, the following were completed:
parent_application_id
andpreceding_application_id
.parent-application-id
and thepreceding-application-id
for the application created for the first time (as draft) and then again, these columns to be updated when the application is edited and submitted again.workers
,queue-consumers
andapi
to adapt to the change in logic.Screenshot:
Rollback evidence: