Add migration to allow question names to be changed
1 files changed, 8 insertions(+), 0 deletions(-)

A => skurvey/migrations/20210219_01_PE7VX-cascade-fks.sql
A => skurvey/migrations/20210219_01_PE7VX-cascade-fks.sql +8 -0
@@ 0,0 1,8 @@ 
+-- Cascade FKs
+-- depends: 20180525_01_k6AEA-create-skurvey-tables
+
+ALTER TABLE skurvey_answers DROP CONSTRAINT "skurvey_answers_question_code_fkey";
+ALTER TABLE skurvey_answers  ADD CONSTRAINT "skurvey_answers_question_code_fkey" FOREIGN KEY (question_code) REFERENCES skurvey_question_codes(question_code) ON UPDATE CASCADE;
+ALTER TABLE skurvey_questions DROP CONSTRAINT "skurvey_questions_question_code_fkey";
+ALTER TABLE skurvey_questions  ADD  CONSTRAINT "skurvey_questions_question_code_fkey" FOREIGN KEY (question_code) REFERENCES skurvey_question_codes(question_code) ON UPDATE CASCADE;
+