From 4347c2947834fe7f2edf2b457b2d513454fc6a03 Mon Sep 17 00:00:00 2001
From: Mike Chen <chagel@gmail.com>
Date: Sun, 5 Jul 2009 10:23:30 +0800
Subject: initiliaze git rep

---
 sql_scripts/cnprog_new_install_2009_04_07.sql | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
 create mode 100644 sql_scripts/cnprog_new_install_2009_04_07.sql

(limited to 'sql_scripts/cnprog_new_install_2009_04_07.sql')

diff --git a/sql_scripts/cnprog_new_install_2009_04_07.sql b/sql_scripts/cnprog_new_install_2009_04_07.sql
new file mode 100644
index 00000000..ff9016fa
--- /dev/null
+++ b/sql_scripts/cnprog_new_install_2009_04_07.sql
@@ -0,0 +1,24 @@
+USE cnprog;
+
+
+/************ Add Foreign Keys to Database ***************/
+
+/************ Foreign Key: fk_activity_auth_user ***************/
+ALTER TABLE activity ADD CONSTRAINT fk_activity_auth_user
+	FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
+
+/************ Foreign Key: fk_question_revision_auth_user ***************/
+ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_auth_user
+	FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
+
+/************ Foreign Key: fk_question_revision_question ***************/
+ALTER TABLE question_revision ADD CONSTRAINT fk_question_revision_question
+	FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
+
+/************ Foreign Key: fk_repute_auth_user ***************/
+ALTER TABLE repute ADD CONSTRAINT fk_repute_auth_user
+	FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
+
+/************ Foreign Key: fk_repute_question ***************/
+ALTER TABLE repute ADD CONSTRAINT fk_repute_question
+	FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
\ No newline at end of file
-- 
cgit v1.2.3-1-g7c22

