a8n: Non-manual Campaigns cannot be deleted due to foreign-key constraint
Created by: mrnugget
When trying to delete a Campaign in the UI that has ChangesetJobs (and Changesets) I get the following message:
pq: update or delete on table "campaigns" violates foreign key constraint "changeset_jobs_campaign_id_fkey" on table "changeset_jobs"
I think we have two options. We either
- change the
campaign_idcolumn definition onchangeset_jobsto have aDELETE CASCADE - we change the
deleteCampaignmutation to load theChangesetJobsfrom the database and delete them manually (while we're at it, we could also delete theCampaignPlanand itsCampaignJobsin the same transaction)