Skip to content

Conversation

@crayolakat
Copy link

Fixes ProgressiveCoders#1673

Description

Currently, we are unable to delete interaction steps with children. The solution is to change the foreign key constraint of parent_interaction_id in the interaction_step table to cascade delete.

Checklist:

  • I have manually tested my changes on desktop and mobile
  • The test suite passes locally with my changes
  • If my change is a UI change, I have attached a screenshot to the description section of this pull request
  • My change is 300 lines of code or less, or has a documented reason in the description why it’s longer
  • I have made any necessary changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works
  • My PR is labeled [WIP] if it is in progress

beforeEach(async () => {
await setupTest();

const startedCampaign = await createStartedCampaign();
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interaction steps of campaigns that have already started are unable to be deleted, so I changed the test to use a campaign that hasn't started yet.

@crayolakat
Copy link
Author

This branch was previously approved and merged into the now inactive community-branches-qa branch, and has been successfully running on MoveOn's prod website for months.

@sonarqubecloud
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
1.5% Duplication on New Code

See analysis details on SonarCloud

@crayolakat crayolakat merged commit 476f2ae into MoveOnOrg:main Feb 29, 2024
@crayolakat crayolakat deleted the cascade_delete_interaction_step branch February 29, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Cannot delete interaction steps unless you delete the innermost questions and responses first

2 participants