-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat(aci): add WorkflowActionGroupStatus take two #92478
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
Conversation
This PR has a migration; here is the generated SQL for for --
-- Raw SQL operation
--
DROP TABLE IF EXISTS workflow_engine_workflowactiongroupstatus;
--
-- Create model WorkflowActionGroupStatus
--
CREATE TABLE "workflow_engine_workflowactiongroupstatus" ("id" bigint NOT NULL PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY, "date_updated" timestamp with time zone NOT NULL, "date_added" timestamp with time zone NOT NULL, "action_id" bigint NOT NULL, "group_id" bigint NOT NULL, "workflow_id" bigint NOT NULL, CONSTRAINT "workflow_engine_uniq_workflow_action_group" UNIQUE ("workflow_id", "action_id", "group_id"));
ALTER TABLE "workflow_engine_workflowactiongroupstatus" ADD CONSTRAINT "workflow_engine_work_action_id_b4d629d5_fk_workflow_" FOREIGN KEY ("action_id") REFERENCES "workflow_engine_action" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflowactiongroupstatus" VALIDATE CONSTRAINT "workflow_engine_work_action_id_b4d629d5_fk_workflow_";
ALTER TABLE "workflow_engine_workflowactiongroupstatus" ADD CONSTRAINT "workflow_engine_work_workflow_id_8110df1d_fk_workflow_" FOREIGN KEY ("workflow_id") REFERENCES "workflow_engine_workflow" ("id") DEFERRABLE INITIALLY DEFERRED NOT VALID;
ALTER TABLE "workflow_engine_workflowactiongroupstatus" VALIDATE CONSTRAINT "workflow_engine_work_workflow_id_8110df1d_fk_workflow_";
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_action_id_b4d629d5" ON "workflow_engine_workflowactiongroupstatus" ("action_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_group_id_89305015" ON "workflow_engine_workflowactiongroupstatus" ("group_id");
CREATE INDEX CONCURRENTLY "workflow_engine_workflowactiongroupstatus_workflow_id_8110df1d" ON "workflow_engine_workflowactiongroupstatus" ("workflow_id"); |
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.
This is going to be a bit painful, because actually the migation fully succeeded on S4S and DE, and partially succeeded on US (the table is created, which you can see in redash).
I think what we should do here is add a SafeRunSQL
operation before the CreateModel
that does a DROP TABLE IF EXISTS workflow_engine_workflowactiongroupstatus;
(include a comment about why we have it there)
As well as this, I think that for the FK to group
, we should set db_constraint=False
, and have a follow-up post_deploy migration that sets db_constraint=True
. That way we can run it out of the deploy and then we don't need to worry about blocking anything.
Codecov ReportAll modified and coverable lines are covered by tests ✅ ✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## master #92478 +/- ##
==========================================
+ Coverage 82.94% 87.89% +4.95%
==========================================
Files 10231 10234 +3
Lines 586224 586661 +437
Branches 22771 22771
==========================================
+ Hits 486230 515671 +29441
+ Misses 99564 70560 -29004
Partials 430 430 |
The previous attempt (#91993) couldn't acquire the lock before 5pm so I reverted it. We try again