4 /************ Add Foreign Keys to Database ***************/
6 /************ Foreign Key: fk_activity_auth_user ***************/
7 ALTER TABLE activity ADD CONSTRAINT fk_activity_auth_user
8 FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
10 /************ Foreign Key: fk_question_revision_auth_user ***************/
11 ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_auth_user
12 FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
14 /************ Foreign Key: fk_question_revision_question ***************/
15 ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_question
16 FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
18 /************ Foreign Key: fk_repute_auth_user ***************/
19 ALTER TABLE repute ADD CONSTRAINT fk_repute_auth_user
20 FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
22 /************ Foreign Key: fk_repute_question ***************/
23 ALTER TABLE repute ADD CONSTRAINT fk_repute_question
24 FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION;