diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-07-10 19:15:04 -0400 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2009-07-10 19:15:04 -0400 |
commit | b49526d6226a48fc157a72d60a2e948c001ca521 (patch) | |
tree | bfce966ce040dd849e8cc35a012d18f7632ad6b1 /sql_scripts | |
parent | f0524f6614d145ee8031cf381342c56e1f065335 (diff) | |
download | askbot-b49526d6226a48fc157a72d60a2e948c001ca521.tar.gz askbot-b49526d6226a48fc157a72d60a2e948c001ca521.tar.bz2 askbot-b49526d6226a48fc157a72d60a2e948c001ca521.zip |
adding all files again
Diffstat (limited to 'sql_scripts')
-rw-r--r-- | sql_scripts/cnprog.xml | 1498 | ||||
-rw-r--r-- | sql_scripts/cnprog_new_install.sql | 811 | ||||
-rw-r--r-- | sql_scripts/cnprog_new_install_2009_02_28.sql | 456 | ||||
-rw-r--r-- | sql_scripts/cnprog_new_install_2009_03_31.sql | 891 | ||||
-rw-r--r-- | sql_scripts/cnprog_new_install_2009_04_07.sql | 24 | ||||
-rw-r--r-- | sql_scripts/cnprog_new_install_2009_04_09.sql | 904 | ||||
-rw-r--r-- | sql_scripts/update_2009_01_13_001.sql | 62 | ||||
-rw-r--r-- | sql_scripts/update_2009_01_13_002.sql | 1 | ||||
-rw-r--r-- | sql_scripts/update_2009_01_18_001.sql | 62 | ||||
-rw-r--r-- | sql_scripts/update_2009_01_24.sql | 2 | ||||
-rw-r--r-- | sql_scripts/update_2009_01_25_001.sql | 2 | ||||
-rw-r--r-- | sql_scripts/update_2009_02_26_001.sql | 19 | ||||
-rw-r--r-- | sql_scripts/update_2009_04_10_001.sql | 3 | ||||
-rw-r--r-- | sql_scripts/update_2009_12_24_001.sql | 5 | ||||
-rw-r--r-- | sql_scripts/update_2009_12_27_001.sql | 3 | ||||
-rw-r--r-- | sql_scripts/update_2009_12_27_002.sql | 1 |
16 files changed, 4744 insertions, 0 deletions
diff --git a/sql_scripts/cnprog.xml b/sql_scripts/cnprog.xml new file mode 100644 index 00000000..95f9b362 --- /dev/null +++ b/sql_scripts/cnprog.xml @@ -0,0 +1,1498 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Db flnm="cnprog" nm="cnprog" ver="1.3.4"> +<VerLbl></VerLbl> +<VerNotes></VerNotes> +<DefTblOpts></DefTblOpts> +<DocFolder>/Users/sailing/Development/cnprog_beta2/sql_scripts</DocFolder> +<Sch Cm="" nm="schemaA"> +<Tbl UsSo="1" nm="activity"> +<TblOpts>ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1</TblOpts> +<Pk ClNs="id" nm="pkactivity"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="activity_type" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="active_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="0" nm="is_auditted" nu="1"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_activity_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="activity" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="activity_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="activity_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="answer"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkanswer"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="author_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="wiki" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="wikified_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="accepted" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="deleted" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="deleted_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="score" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="comment_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="offensive_flag_count" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_edited_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_edited_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="html" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="vote_up_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="vote_down_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="accepted_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="deleted_by_id_refs_id_192b0170" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="answer" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="deleted_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_answer_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="answer" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="author_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_answer_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="answer" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="last_edited_by_id_refs_id_192b0170" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="answer" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="last_edited_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="locked_by_id_refs_id_192b0170" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="answer" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="locked_by_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="answer_author_id" unq="0"> +<ClNs>author_id</ClNs> +</Idx> +<Idx clu="0" nm="answer_deleted_by_id" unq="0"> +<ClNs>deleted_by_id</ClNs> +</Idx> +<Idx clu="0" nm="answer_last_edited_by_id" unq="0"> +<ClNs>last_edited_by_id</ClNs> +</Idx> +<Idx clu="0" nm="answer_locked_by_id" unq="0"> +<ClNs>locked_by_id</ClNs> +</Idx> +<Idx clu="0" nm="answer_question_id" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="answer_revision"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci</TblOpts> +<Pk ClNs="id" nm="pkanswer_revision"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="answer_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="revision" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="author_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="revised_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="summary" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="text" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_answer_revision_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="answer_revision" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="author_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="answer_revision_answer_id" unq="0"> +<ClNs>answer_id</ClNs> +</Idx> +<Idx clu="0" nm="answer_revision_author_id" unq="0"> +<ClNs>author_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_group"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_group"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="80" sc="null" sg="1"/> +</Cl> +<Idx clu="0" nm="name" unq="1"> +<ClNs>name</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_group_permissions"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_group_permissions"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="group_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="permission_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_auth_group_permissions_auth_group" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_group" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_group_permissions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="group_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_auth_group_permissions_auth_permission" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_permission" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_group_permissions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="permission_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="group_id" unq="1"> +<ClNs>group_id, permission_id</ClNs> +</Idx> +<Idx clu="0" nm="permission_id_refs_id_5886d21f" unq="0"> +<ClNs>permission_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_message"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_message"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="message" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_auth_message_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_message" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="auth_message_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_permission"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_permission"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="50" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="codename" nu="0"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_auth_permission_django_content_type" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="django_content_type" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_permission" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="content_type_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="auth_permission_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="content_type_id" unq="1"> +<ClNs>content_type_id, codename</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_user"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_user"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="username" nu="0"> +<DT ds="VarChar" en="" id="12" ln="30" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="first_name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="30" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="30" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="email" nu="0"> +<DT ds="VarChar" en="" id="12" ln="75" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="password" nu="0"> +<DT ds="VarChar" en="" id="12" ln="128" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="is_staff" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="is_active" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="is_superuser" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_login" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="date_joined" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="0" nm="gold" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="0" nm="silver" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="0" nm="bronze" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="1" nm="reputation" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="gravatar" nu="1"> +<DT ds="VarChar" en="" id="12" ln="128" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="10" nm="questions_per_page" nu="1"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="last_seen" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="real_name" nu="1"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="website" nu="1"> +<DT ds="VarChar" en="" id="12" ln="200" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="location" nu="1"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="date_of_birth" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="about" nu="1"> +<DT ds="Text" en="" id="703" ln="null" sc="null" sg="1"/> +</Cl> +<Idx clu="0" nm="username" unq="1"> +<ClNs>username</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_user_groups"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_user_groups"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="group_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_auth_user_groups_auth_group" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_group" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_user_groups" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="group_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_auth_user_groups_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_user_groups" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="group_id_refs_id_f116770" unq="0"> +<ClNs>group_id</ClNs> +</Idx> +<Idx clu="0" nm="user_id" unq="1"> +<ClNs>user_id, group_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="auth_user_user_permissions"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkauth_user_user_permissions"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="permission_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_auth_user_user_permissions_auth_permission" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_permission" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_user_user_permissions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="permission_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_auth_user_user_permissions_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="auth_user_user_permissions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="permission_id_refs_id_67e79cb" unq="0"> +<ClNs>permission_id</ClNs> +</Idx> +<Idx clu="0" nm="user_id" unq="1"> +<ClNs>user_id, permission_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="award"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkaward"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="badge_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="awarded_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="notified" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_award_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="award" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_award_badge" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="badge" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="award" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="badge_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="award_badge_id" unq="0"> +<ClNs>badge_id</ClNs> +</Idx> +<Idx clu="0" nm="award_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="badge"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkbadge"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="50" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="type" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="slug" nu="0"> +<DT ds="VarChar" en="" id="12" ln="50" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="description" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="multiple" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="awarded_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Idx clu="0" nm="badge_slug" unq="0"> +<ClNs>slug</ClNs> +</Idx> +<Idx clu="0" nm="name" unq="1"> +<ClNs>name, type</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="book"> +<TblOpts></TblOpts> +<Pk ClNs="id" nm="pkbook"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="title" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="short_name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="author" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="price" nu="1"> +<DT ds="Decimal" en="" id="3" ln="10" sc="2" sg="1"/> +</Cl> +<Cl au="0" df="" nm="pages" nu="1"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="published_at" nu="0"> +<DT ds="Date" en="" id="91" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="publication" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="cover_img" nu="1"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="tagnames" nu="1"> +<DT ds="VarChar" en="" id="12" ln="125" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_edited_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_books_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="book_short_name_Idx" unq="1"> +<ClNs>short_name</ClNs> +</Idx> +<Idx clu="0" nm="fk_books_auth_user" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="book_author_info"> +<TblOpts></TblOpts> +<Pk ClNs="id" nm="pkbook_author_info"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="blog_url" nu="1"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_edited_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="book_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_book_author_info_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_author_info" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_book_author_info_book" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="book" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_author_info" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="book_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="fk_book_author_info_auth_user" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<Idx clu="0" nm="fk_book_author_info_book" unq="0"> +<ClNs>book_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="book_author_rss"> +<TblOpts></TblOpts> +<Pk ClNs="id" nm="pkbook_author_rss"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="title" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="url" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="rss_created_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="book_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_book_author_rss_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_author_rss" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_book_author_rss_book" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="book" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_author_rss" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="book_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="fk_book_author_rss_auth_user" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<Idx clu="0" nm="fk_book_author_rss_book" unq="0"> +<ClNs>book_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="book_question"> +<TblOpts></TblOpts> +<Pk ClNs="id" nm="pkbook_question"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="book_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_book_question_book" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="book" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="book_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_book_question_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="book_question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="fk_book_question_book" unq="0"> +<ClNs>book_id</ClNs> +</Idx> +<Idx clu="0" nm="fk_book_question_question" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="comment"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkcomment"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="comment" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_comment_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="comment" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_comment_django_content_type" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="django_content_type" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="comment" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="content_type_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="comment_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="comment_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<Idx clu="0" nm="content_type_id" unq="0"> +<ClNs>content_type_id, object_id, user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_admin_log"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_admin_log"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="action_time" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="1"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_repr" nu="0"> +<DT ds="VarChar" en="" id="12" ln="200" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="action_flag" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="change_message" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_django_admin_log_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="django_admin_log" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_django_admin_log_django_content_type" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="django_content_type" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="django_admin_log" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="content_type_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="django_admin_log_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="django_admin_log_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_authopenid_association"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_authopenid_association"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="server_url" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="handle" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="secret" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="issued" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="lifetime" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="assoc_type" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_authopenid_nonce"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_authopenid_nonce"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="server_url" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="timestamp" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="salt" nu="0"> +<DT ds="VarChar" en="" id="12" ln="40" sc="null" sg="1"/> +</Cl> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_authopenid_userassociation"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_authopenid_userassociation"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="openid_url" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_django_authopenid_userassociation_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="django_authopenid_userassociation" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="user_id" unq="1"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_authopenid_userpasswordqueue"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_authopenid_userpasswordqueue"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="new_password" nu="0"> +<DT ds="VarChar" en="" id="12" ln="30" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="confirm_key" nu="0"> +<DT ds="VarChar" en="" id="12" ln="40" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_django_authopenid_userpasswordqueue_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="django_authopenid_userpasswordqueue" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="user_id" unq="1"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_content_type"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_content_type"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="app_label" nu="0"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="model" nu="0"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Idx clu="0" nm="app_label" unq="1"> +<ClNs>app_label, model</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_session"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="session_key" nm="pkdjango_session"/> +<Cl au="0" df="" nm="session_key" nu="0"> +<DT ds="VarChar" en="" id="12" ln="40" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="session_data" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="expire_date" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="django_site"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkdjango_site"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="domain" nu="0"> +<DT ds="VarChar" en="" id="12" ln="100" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="50" sc="null" sg="1"/> +</Cl> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="favorite_question"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkfavorite_question"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_favorite_question_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="favorite_question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_favorite_question_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="favorite_question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="favorite_question_question_id" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<Idx clu="0" nm="favorite_question_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="flagged_item"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkflagged_item"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="flagged_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_flagged_item_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="flagged_item" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_flagged_item_django_content_type" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="django_content_type" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="flagged_item" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="content_type_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="content_type_id" unq="1"> +<ClNs>content_type_id, object_id, user_id</ClNs> +</Idx> +<Idx clu="0" nm="flagged_item_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="flagged_item_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="question"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkquestion"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="title" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="author_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="added_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="wiki" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="wikified_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="answer_accepted" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="closed" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="closed_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="closed_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="close_reason" nu="1"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="deleted" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="deleted_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="deleted_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked" nu="0"> +<DT ds="TinyInt" en="" id="-6" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="locked_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="score" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="answer_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="comment_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="view_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="offensive_flag_count" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="favourite_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="last_edited_at" nu="1"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_edited_by_id" nu="1"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_activity_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="last_activity_by_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="tagnames" nu="0"> +<DT ds="VarChar" en="" id="12" ln="125" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="summary" nu="0"> +<DT ds="VarChar" en="" id="12" ln="180" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="html" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="vote_up_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="vote_down_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="closed_by_id_refs_id_56e9d00c" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="closed_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="deleted_by_id_refs_id_56e9d00c" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="deleted_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_question_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="author_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="last_activity_by_id_refs_id_56e9d00c" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="last_activity_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="last_edited_by_id_refs_id_56e9d00c" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="last_edited_by_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="locked_by_id_refs_id_56e9d00c" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="1"/> +<CdTb mn="1" nm="question" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="locked_by_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="question_author_id" unq="0"> +<ClNs>author_id</ClNs> +</Idx> +<Idx clu="0" nm="question_closed_by_id" unq="0"> +<ClNs>closed_by_id</ClNs> +</Idx> +<Idx clu="0" nm="question_deleted_by_id" unq="0"> +<ClNs>deleted_by_id</ClNs> +</Idx> +<Idx clu="0" nm="question_last_activity_by_id" unq="0"> +<ClNs>last_activity_by_id</ClNs> +</Idx> +<Idx clu="0" nm="question_last_edited_by_id" unq="0"> +<ClNs>last_edited_by_id</ClNs> +</Idx> +<Idx clu="0" nm="question_locked_by_id" unq="0"> +<ClNs>locked_by_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="question_revision"> +<TblOpts>ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1</TblOpts> +<Pk ClNs="id" nm="pkquestion_revision"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="revision" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="title" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="author_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="revised_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="tagnames" nu="0"> +<DT ds="VarChar" en="" id="12" ln="125" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="summary" nu="0"> +<DT ds="VarChar" en="" id="12" ln="300" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="text" nu="0"> +<DT ds="LongText" en="" id="712" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_question_revision_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question_revision" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="author_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_question_revision_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question_revision" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="question_revision_author_id" unq="0"> +<ClNs>author_id</ClNs> +</Idx> +<Idx clu="0" nm="question_revision_question_id" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="question_tags"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkquestion_tags"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="tag_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_question_tags_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question_tags" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_question_tags_tag" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="tag" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="question_tags" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="tag_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="question_id" unq="1"> +<ClNs>question_id, tag_id</ClNs> +</Idx> +<Idx clu="0" nm="tag_id_refs_id_43fcb953" unq="0"> +<ClNs>tag_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="repute"> +<TblOpts>ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1</TblOpts> +<Pk ClNs="id" nm="pkrepute"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="positive" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="negative" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="reputed_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="reputation_type" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="reputation" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_repute_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="repute" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_repute_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="repute" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="repute_question_id" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<Idx clu="0" nm="repute_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="tag"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pktag"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="name" nu="0"> +<DT ds="VarChar" en="" id="12" ln="255" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="created_by_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="used_count" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Fk deAc="3" nm="fk_tag_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="tag" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="created_by_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="name" unq="1"> +<ClNs>name</ClNs> +</Idx> +<Idx clu="0" nm="tag_created_by_id" unq="0"> +<ClNs>created_by_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="user_badge"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkuser_badge"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="badge_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_user_badge_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="user_badge" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_user_badge_badge" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="badge" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="user_badge" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="badge_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="fk_user_badge_auth_user" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<Idx clu="0" nm="fk_user_badge_badge" unq="0"> +<ClNs>badge_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="user_favorite_questions"> +<TblOpts>ENGINE=InnoDB DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkuser_favorite_questions"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="question_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_user_favorite_questions_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="user_favorite_questions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_user_favorite_questions_question" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="question" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="user_favorite_questions" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="question_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="fk_user_favorite_questions_auth_user" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<Idx clu="0" nm="fk_user_favorite_questions_question" unq="0"> +<ClNs>question_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +<Tbl UsSo="1" nm="vote"> +<TblOpts>ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8</TblOpts> +<Pk ClNs="id" nm="pkvote"/> +<Cl au="1" df="" nm="id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="content_type_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="object_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="0"/> +</Cl> +<Cl au="0" df="" nm="user_id" nu="0"> +<DT ds="Integer" en="" id="4" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="vote" nu="0"> +<DT ds="SmallInt" en="" id="5" ln="null" sc="null" sg="1"/> +</Cl> +<Cl au="0" df="" nm="voted_at" nu="0"> +<DT ds="DateTime" en="" id="700" ln="null" sc="null" sg="1"/> +</Cl> +<Fk deAc="3" nm="fk_vote_auth_user" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="auth_user" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="vote" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="user_id" prCl="id"/> +</Fk> +<Fk deAc="3" nm="fk_vote_django_content_type" prLkCl="id" upAc="3"> +<PrTb mn="0" nm="django_content_type" oe="1" sch="schemaA" zr="0"/> +<CdTb mn="1" nm="vote" oe="1" sch="schemaA" zr="1"/> +<ClPr cdCl="content_type_id" prCl="id"/> +</Fk> +<Idx clu="0" nm="content_type_id" unq="1"> +<ClNs>content_type_id, object_id, user_id</ClNs> +</Idx> +<Idx clu="0" nm="vote_content_type_id" unq="0"> +<ClNs>content_type_id</ClNs> +</Idx> +<Idx clu="0" nm="vote_user_id" unq="0"> +<ClNs>user_id</ClNs> +</Idx> +<SchTrHis/> +</Tbl> +</Sch> +<Dgm nm="diagramA"> +<RnCf FtSz="12" lkStgy="OffsetDirect" zm="1.0"> +<VbCfg> +<Fg ky="Auto Number" vl="0"/> +<Fg ky="Check" vl="0"/> +<Fg ky="Comment" vl="0"/> +<Fg ky="Data Type" vl="1"/> +<Fg ky="Default" vl="0"/> +<Fg ky="ENUM Values" vl="0"/> +<Fg ky="Length" vl="1"/> +<Fg ky="Name" vl="1"/> +<Fg ky="Nullable" vl="0"/> +<Fg ky="Schema Name" vl="0"/> +<Fg ky="Signed" vl="0"/> +</VbCfg> +</RnCf> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="activity" x="811" y="284"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="answer" x="413" y="472"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="answer_revision" x="1067" y="41"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_group" x="593" y="703"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_group_permissions" x="765" y="703"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_message" x="323" y="1441"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_permission" x="636" y="794"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_user" x="50" y="50"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_user_groups" x="403" y="703"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="auth_user_user_permissions" x="393" y="794"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="award" x="373" y="971"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="badge" x="606" y="971"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="comment" x="383" y="880"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_admin_log" x="363" y="1087"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_authopenid_association" x="1543" y="50"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_authopenid_nonce" x="1781" y="50"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_authopenid_userassociation" x="313" y="1502"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_authopenid_userpasswordqueue" x="303" y="1563"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_content_type" x="636" y="880"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_session" x="1088" y="222"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="django_site" x="1312" y="152"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="favorite_question" x="433" y="50"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="flagged_item" x="353" y="1198"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="question" x="423" y="121"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="question_revision" x="1380" y="241"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="question_tags" x="736" y="121"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="repute" x="1661" y="180"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="tag" x="343" y="1279"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="user_badge" x="916" y="200"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="user_favorite_questions" x="1070" y="366"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="vote" x="93" y="1341"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="book" x="962" y="1063"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="book_question" x="702" y="1160"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="book_author_info" x="931" y="1436"/> +<TbGl bkCl="ffffffe6" sch="schemaA" tbl="book_author_rss" x="619" y="1321"/> +<FkGl bkCl="ff000000" nm="schemaA.activity.fk_activity_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.answer.deleted_by_id_refs_id_192b0170"/> +<FkGl bkCl="ff000000" nm="schemaA.answer.fk_answer_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.answer.fk_answer_question"/> +<FkGl bkCl="ff000000" nm="schemaA.answer.last_edited_by_id_refs_id_192b0170"/> +<FkGl bkCl="ff000000" nm="schemaA.answer.locked_by_id_refs_id_192b0170"/> +<FkGl bkCl="ff000000" nm="schemaA.answer_revision.fk_answer_revision_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_group_permissions.fk_auth_group_permissions_auth_group"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_group_permissions.fk_auth_group_permissions_auth_permission"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_message.fk_auth_message_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_permission.fk_auth_permission_django_content_type"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_user_groups.fk_auth_user_groups_auth_group"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_user_groups.fk_auth_user_groups_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_user_user_permissions.fk_auth_user_user_permissions_auth_permission"/> +<FkGl bkCl="ff000000" nm="schemaA.auth_user_user_permissions.fk_auth_user_user_permissions_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.award.fk_award_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.award.fk_award_badge"/> +<FkGl bkCl="ff000000" nm="schemaA.book.fk_books_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.book_author_info.fk_book_author_info_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.book_author_info.fk_book_author_info_book"/> +<FkGl bkCl="ff000000" nm="schemaA.book_author_rss.fk_book_author_rss_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.book_author_rss.fk_book_author_rss_book"/> +<FkGl bkCl="ff000000" nm="schemaA.book_question.fk_book_question_book"/> +<FkGl bkCl="ff000000" nm="schemaA.book_question.fk_book_question_question"/> +<FkGl bkCl="ff000000" nm="schemaA.comment.fk_comment_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.comment.fk_comment_django_content_type"/> +<FkGl bkCl="ff000000" nm="schemaA.django_admin_log.fk_django_admin_log_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.django_admin_log.fk_django_admin_log_django_content_type"/> +<FkGl bkCl="ff000000" nm="schemaA.django_authopenid_userassociation.fk_django_authopenid_userassociation_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.django_authopenid_userpasswordqueue.fk_django_authopenid_userpasswordqueue_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.favorite_question.fk_favorite_question_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.favorite_question.fk_favorite_question_question"/> +<FkGl bkCl="ff000000" nm="schemaA.flagged_item.fk_flagged_item_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.flagged_item.fk_flagged_item_django_content_type"/> +<FkGl bkCl="ff000000" nm="schemaA.question.closed_by_id_refs_id_56e9d00c"/> +<FkGl bkCl="ff000000" nm="schemaA.question.deleted_by_id_refs_id_56e9d00c"/> +<FkGl bkCl="ff000000" nm="schemaA.question.fk_question_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.question.last_activity_by_id_refs_id_56e9d00c"/> +<FkGl bkCl="ff000000" nm="schemaA.question.last_edited_by_id_refs_id_56e9d00c"/> +<FkGl bkCl="ff000000" nm="schemaA.question.locked_by_id_refs_id_56e9d00c"/> +<FkGl bkCl="ff000000" nm="schemaA.question_revision.fk_question_revision_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.question_revision.fk_question_revision_question"/> +<FkGl bkCl="ff000000" nm="schemaA.question_tags.fk_question_tags_question"/> +<FkGl bkCl="ff000000" nm="schemaA.question_tags.fk_question_tags_tag"/> +<FkGl bkCl="ff000000" nm="schemaA.repute.fk_repute_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.repute.fk_repute_question"/> +<FkGl bkCl="ff000000" nm="schemaA.tag.fk_tag_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.user_badge.fk_user_badge_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.user_badge.fk_user_badge_badge"/> +<FkGl bkCl="ff000000" nm="schemaA.user_favorite_questions.fk_user_favorite_questions_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.user_favorite_questions.fk_user_favorite_questions_question"/> +<FkGl bkCl="ff000000" nm="schemaA.vote.fk_vote_auth_user"/> +<FkGl bkCl="ff000000" nm="schemaA.vote.fk_vote_django_content_type"/> +</Dgm> +<RnmMgr NxRnmId="6"> +<RnmCh ObjCls="Table" ParCls="Schema" ParNme="schemaA" SupCls="" SupNme=""> +<Rnm id="1" nNm="book" oNm="books"/> +</RnmCh> +<RnmCh ObjCls="Table" ParCls="Schema" ParNme="schemaA" SupCls="" SupNme=""> +<Rnm id="2" nNm="book_question" oNm="books_questions"/> +</RnmCh> +<RnmCh ObjCls="Column" ParCls="Table" ParNme="book_question" SupCls="Schema" SupNme="schemaA"> +<Rnm id="3" nNm="id" oNm="books_questions_id"/> +</RnmCh> +<RnmCh ObjCls="Column" ParCls="Table" ParNme="book_author_rss" SupCls="Schema" SupNme="schemaA"> +<Rnm id="4" nNm="user_id" oNm="book_author_id"/> +</RnmCh> +<RnmCh ObjCls="Column" ParCls="Table" ParNme="book" SupCls="Schema" SupNme="schemaA"> +<Rnm id="5" nNm="short_name" oNm="shot_name"/> +</RnmCh> +</RnmMgr> +<DbDocOptionMgr> +<BasicOptionMgr> +<Name>db.doc.option.mgr</Name> +<BoolOpt lbl="Diagrams" nm="doc.diagrams" on="1" spl="0"/> +<BoolOpt lbl="Foreign Keys" nm="doc.fks" on="1" spl="0"/> +<BoolOpt lbl="Indexes" nm="doc.indexes" on="1" spl="0"/> +<BoolOpt lbl="Overwrite CSS File" nm="doc.overwrite.css" on="1" spl="0"/> +<BoolOpt lbl="Procedures" nm="doc.procs" on="1" spl="0"/> +<BoolOpt lbl="Schemas" nm="doc.schemas" on="1" spl="0"/> +<BoolOpt lbl="Sequences" nm="doc.sequences" on="1" spl="0"/> +<BoolOpt lbl="Tables" nm="doc.tables" on="1" spl="0"/> +<BoolOpt lbl="Triggers" nm="doc.triggers" on="1" spl="0"/> +<BoolOpt lbl="Views" nm="doc.views" on="1" spl="0"/> +</BasicOptionMgr> +</DbDocOptionMgr> +</Db> diff --git a/sql_scripts/cnprog_new_install.sql b/sql_scripts/cnprog_new_install.sql new file mode 100644 index 00000000..ac33a6ba --- /dev/null +++ b/sql_scripts/cnprog_new_install.sql @@ -0,0 +1,811 @@ +-- MySQL Administrator dump 1.4 +-- +-- ------------------------------------------------------ +-- Server version 5.0.67 + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; +/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; +/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; + + +-- +-- Create schema cnprog +-- + +CREATE DATABASE IF NOT EXISTS cnprog; +USE cnprog; + +-- +-- Definition of table `cnprog`.`answer` +-- + +DROP TABLE IF EXISTS `cnprog`.`answer`; +CREATE TABLE `cnprog`.`answer` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `author_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + `wiki` tinyint(1) NOT NULL, + `wikified_at` datetime default NULL, + `accepted` tinyint(1) NOT NULL, + `deleted` tinyint(1) NOT NULL, + `deleted_by_id` int(11) default NULL, + `locked` tinyint(1) NOT NULL, + `locked_by_id` int(11) default NULL, + `locked_at` datetime default NULL, + `score` int(11) NOT NULL, + `vote_up_count` int(11) NOT NULL, + `vote_down_count` int(11) NOT NULL, + `comment_count` int(10) unsigned NOT NULL, + `offensive_flag_count` smallint(6) NOT NULL, + `last_edited_at` datetime default NULL, + `last_edited_by_id` int(11) default NULL, + `html` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `answer_question_id` (`question_id`), + KEY `answer_author_id` (`author_id`), + KEY `answer_deleted_by_id` (`deleted_by_id`), + KEY `answer_locked_by_id` (`locked_by_id`), + KEY `answer_last_edited_by_id` (`last_edited_by_id`), + CONSTRAINT `author_id_refs_id_192b0170` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `deleted_by_id_refs_id_192b0170` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_edited_by_id_refs_id_192b0170` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `locked_by_id_refs_id_192b0170` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `question_id_refs_id_7d6550c9` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`auth_group` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_group`; +CREATE TABLE `cnprog`.`auth_group` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(80) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_group` +-- + +-- +-- Definition of table `cnprog`.`auth_group_permissions` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_group_permissions`; +CREATE TABLE `cnprog`.`auth_group_permissions` ( + `id` int(11) NOT NULL auto_increment, + `group_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `group_id` (`group_id`,`permission_id`), + KEY `permission_id_refs_id_5886d21f` (`permission_id`), + CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), + CONSTRAINT `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_group_permissions` +-- + +-- +-- Definition of table `cnprog`.`auth_message` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_message`; +CREATE TABLE `cnprog`.`auth_message` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `message` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `auth_message_user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_650f49a6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_message` +-- + +-- +-- Definition of table `cnprog`.`auth_permission` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_permission`; +CREATE TABLE `cnprog`.`auth_permission` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL, + `content_type_id` int(11) NOT NULL, + `codename` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`codename`), + KEY `auth_permission_content_type_id` (`content_type_id`), + CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=76 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_permission` +-- +INSERT INTO `cnprog`.`auth_permission` VALUES (1,'Can add permission',1,'add_permission'), + (2,'Can change permission',1,'change_permission'), + (3,'Can delete permission',1,'delete_permission'), + (4,'Can add group',2,'add_group'), + (5,'Can change group',2,'change_group'), + (6,'Can delete group',2,'delete_group'), + (7,'Can add user',3,'add_user'), + (8,'Can change user',3,'change_user'), + (9,'Can delete user',3,'delete_user'), + (10,'Can add message',4,'add_message'), + (11,'Can change message',4,'change_message'), + (12,'Can delete message',4,'delete_message'), + (13,'Can add content type',5,'add_contenttype'), + (14,'Can change content type',5,'change_contenttype'), + (15,'Can delete content type',5,'delete_contenttype'), + (16,'Can add session',6,'add_session'), + (17,'Can change session',6,'change_session'), + (18,'Can delete session',6,'delete_session'), + (19,'Can add site',7,'add_site'), + (20,'Can change site',7,'change_site'), + (21,'Can delete site',7,'delete_site'), + (25,'Can add answer',9,'add_answer'), + (26,'Can change answer',9,'change_answer'), + (27,'Can delete answer',9,'delete_answer'), + (28,'Can add comment',10,'add_comment'), + (29,'Can change comment',10,'change_comment'), + (30,'Can delete comment',10,'delete_comment'), + (31,'Can add tag',11,'add_tag'), + (32,'Can change tag',11,'change_tag'), + (33,'Can delete tag',11,'delete_tag'), + (37,'Can add nonce',13,'add_nonce'), + (38,'Can change nonce',13,'change_nonce'), + (39,'Can delete nonce',13,'delete_nonce'), + (40,'Can add association',14,'add_association'), + (41,'Can change association',14,'change_association'), + (42,'Can delete association',14,'delete_association'), + (43,'Can add nonce',15,'add_nonce'), + (44,'Can change nonce',15,'change_nonce'), + (45,'Can delete nonce',15,'delete_nonce'), + (46,'Can add association',16,'add_association'), + (47,'Can change association',16,'change_association'), + (48,'Can delete association',16,'delete_association'), + (49,'Can add user association',17,'add_userassociation'), + (50,'Can change user association',17,'change_userassociation'), + (51,'Can delete user association',17,'delete_userassociation'), + (52,'Can add user password queue',18,'add_userpasswordqueue'), + (53,'Can change user password queue',18,'change_userpasswordqueue'), + (54,'Can delete user password queue',18,'delete_userpasswordqueue'), + (55,'Can add log entry',19,'add_logentry'), + (56,'Can change log entry',19,'change_logentry'), + (57,'Can delete log entry',19,'delete_logentry'), + (58,'Can add question',20,'add_question'), + (59,'Can change question',20,'change_question'), + (60,'Can delete question',20,'delete_question'), + (61,'Can add vote',21,'add_vote'), + (62,'Can change vote',21,'change_vote'), + (63,'Can delete vote',21,'delete_vote'), + (64,'Can add flagged item',22,'add_flaggeditem'), + (65,'Can change flagged item',22,'change_flaggeditem'), + (66,'Can delete flagged item',22,'delete_flaggeditem'), + (67,'Can add favorite question',23,'add_favoritequestion'), + (68,'Can change favorite question',23,'change_favoritequestion'), + (69,'Can delete favorite question',23,'delete_favoritequestion'), + (70,'Can add badge',24,'add_badge'), + (71,'Can change badge',24,'change_badge'), + (72,'Can delete badge',24,'delete_badge'), + (73,'Can add award',25,'add_award'), + (74,'Can change award',25,'change_award'), + (75,'Can delete award',25,'delete_award'); + +-- +-- Definition of table `cnprog`.`auth_user` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_user`; +CREATE TABLE `cnprog`.`auth_user` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(30) NOT NULL, + `first_name` varchar(30) NOT NULL, + `last_name` varchar(30) NOT NULL, + `email` varchar(75) NOT NULL, + `password` varchar(128) NOT NULL, + `is_staff` tinyint(1) NOT NULL, + `is_active` tinyint(1) NOT NULL, + `is_superuser` tinyint(1) NOT NULL, + `last_login` datetime NOT NULL, + `date_joined` datetime NOT NULL, + `gold` smallint(6) NOT NULL default '0', + `silver` smallint(5) unsigned NOT NULL default '0', + `bronze` smallint(5) unsigned NOT NULL default '0', + `reputation` int(10) unsigned default '1', + `gravatar` varchar(128) default NULL, + `questions_per_page` smallint(5) unsigned default '10', + `last_seen` datetime default NULL, + `real_name` varchar(100) default NULL, + `website` varchar(200) default NULL, + `location` varchar(100) default NULL, + `date_of_birth` datetime default NULL, + `about` text, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_user` +-- +INSERT INTO `cnprog`.`auth_user` VALUES (2,'chagel','','','chagel@gmail.com','sha1$6a2fb$0d2ffe90bcba542fc962f57967a88e507799cc74',1,1,1,'2008-12-16 15:35:17','2008-12-11 20:12:53',0,0,0,1,'8c1efc4f4618aa68b18c88f2bcaa5564',10,NULL,NULL,NULL,NULL,NULL,NULL), + (3,'mike','','','ichagel@yahoo.com','sha1$f7ef5$1015ae6b2c8a2774a028419d3c57e13145b83284',0,1,0,'2008-12-15 12:56:23','2008-12-15 12:56:23',0,0,0,1,NULL,10,NULL,NULL,NULL,NULL,NULL,NULL), + (4,'sailingcai','','','sailingcai@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-23 06:14:45','2008-12-20 15:19:21',1,2,3,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','',NULL,''), + (5,'sailingcai1','','','1@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21',NULL,NULL,NULL,NULL,NULL), + (6,'sailing2','','','2@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (7,'sailing3','','','3@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (8,'sailing4','','','4@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (9,'sailing5','','','5@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (10,'sailing6','','','6@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (11,'sailing7','','','7@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (12,'sailing8','','','8@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (13,'sailing9','','','9@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (14,'sailing10','','','10@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (15,'sailing11','','','11@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (16,'sailing12','','','12@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (17,'sailing13','','','13@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (18,'sailing14','','','14@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (19,'sailing15','','','15@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (20,'sailing16','','','16@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (21,'sailing17','','','17@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (22,'sailing18','','','18@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (23,'sailing19','','','19@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (24,'sailing20','','','20@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (25,'sailing21','','','21@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (26,'sailing22','','','22@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (27,'sailing23','','','23@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (28,'sailing24','','','24@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (29,'sailing25','','','25@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (30,'sailing26','','','26@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (31,'sailing27','','','27@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (32,'sailing28','','','28@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (33,'sailing29','','','29@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (34,'sailing30','','','30@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (35,'sailing31','','','31@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (36,'sailing32','','','32@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (37,'sailing33','','','33@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (38,'sailing34','','','34@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (39,'sailing35','','','35@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (40,'sailing36','','','36@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (41,'sailing37','','','37@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (42,'sailing38','','','38@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (43,'sailing39','','','39@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (44,'sailing40','','','40@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (45,'sailing41','','','41@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (46,'sailing42','','','42@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (47,'sailing43','','','43@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (48,'sailing44','','','44@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (49,'sailing45','','','45@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (50,'sailing46','','','46@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (51,'sailing47','','','47@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (52,'sailing48','','','48@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (53,'sailing49','','','49@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (54,'sailing50','','','50@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (55,'sailing51','','','51@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (56,'sailing52','','','52@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (57,'sailing53','','','53@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (58,'sailing54','','','54@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (59,'sailing55','','','55@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (60,'sailing56','','','56@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (61,'sailing57','','','57@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (62,'sailing58','','','58@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (63,'sailing59','','','59@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (64,'sailing60','','','60@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (65,'sailing61','','','61@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (66,'sailing62','','','62@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (67,'sailing63','','','63@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (68,'sailing64','','','64@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (69,'sailing65','','','65@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (70,'sailing66','','','66@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (71,'sailing67','','','67@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (72,'sailing68','','','68@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (73,'sailing69','','','69@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (74,'sailing70','','','70@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (75,'sailing71','','','71@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (76,'sailing72','','','72@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (77,'sailing73','','','73@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (78,'sailing74','','','74@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (79,'sailing75','','','75@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (80,'sailing76','','','76@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (81,'sailing77','','','77@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (82,'sailing78','','','78@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (83,'sailing79','','','79@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (84,'sailing80','','','80@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (85,'sailing81','','','81@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (86,'sailing82','','','82@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (87,'sailing83','','','83@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (88,'sailing84','','','84@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (89,'sailing85','','','85@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (90,'sailing86','','','86@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (91,'sailing87','','','87@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (92,'sailing88','','','88@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (93,'sailing89','','','89@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (94,'sailing90','','','90@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (95,'sailing91','','','91@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (96,'sailing92','','','92@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (97,'sailing93','','','93@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (98,'sailing94','','','94@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (99,'sailing95','','','95@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (100,'sailing96','','','96@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (101,'sailing97','','','97@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (102,'sailing98','','','98@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''), + (103,'sailing99','','','99@gmail.com','sha1$a417c$ca7d9f2ad55666bf98068cc392b6f62450b216e0',0,1,0,'2008-12-20 15:19:21','2008-12-20 15:19:21',0,0,0,1,'a1cb9864605a32760518b90a4f9a0e73',10,'2008-12-20 15:19:21','','','','0000-00-00 00:00:00',''); + +-- +-- Definition of table `cnprog`.`auth_user_groups` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_user_groups`; +CREATE TABLE `cnprog`.`auth_user_groups` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `group_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`,`group_id`), + KEY `group_id_refs_id_f116770` (`group_id`), + CONSTRAINT `group_id_refs_id_f116770` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), + CONSTRAINT `user_id_refs_id_7ceef80f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_user_groups` +-- + +-- +-- Definition of table `cnprog`.`auth_user_user_permissions` +-- + +DROP TABLE IF EXISTS `cnprog`.`auth_user_user_permissions`; +CREATE TABLE `cnprog`.`auth_user_user_permissions` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`,`permission_id`), + KEY `permission_id_refs_id_67e79cb` (`permission_id`), + CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), + CONSTRAINT `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`auth_user_user_permissions` +-- + +-- +-- Definition of table `cnprog`.`award` +-- + +DROP TABLE IF EXISTS `cnprog`.`award`; +CREATE TABLE `cnprog`.`award` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `badge_id` int(11) NOT NULL, + `awarded_at` datetime NOT NULL, + `notified` tinyint(1) NOT NULL, + PRIMARY KEY (`id`), + KEY `award_user_id` (`user_id`), + KEY `award_badge_id` (`badge_id`), + CONSTRAINT `badge_id_refs_id_651af0e1` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`), + CONSTRAINT `user_id_refs_id_2d83e9b6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`award` +-- + +-- +-- Definition of table `cnprog`.`badge` +-- + +DROP TABLE IF EXISTS `cnprog`.`badge`; +CREATE TABLE `cnprog`.`badge` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL, + `type` smallint(6) NOT NULL, + `slug` varchar(50) NOT NULL, + `description` varchar(300) NOT NULL, + `multiple` tinyint(1) NOT NULL, + `awarded_count` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`,`type`), + KEY `badge_slug` (`slug`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`badge` +-- + +-- +-- Definition of table `cnprog`.`comment` +-- + +DROP TABLE IF EXISTS `cnprog`.`comment`; +CREATE TABLE `cnprog`.`comment` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `comment` varchar(300) NOT NULL, + `added_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + KEY `comment_content_type_id` (`content_type_id`), + KEY `comment_user_id` (`user_id`), + CONSTRAINT `content_type_id_refs_id_13a5866c` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_6be725e8` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`comment` +-- + +-- +-- Definition of table `cnprog`.`django_admin_log` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_admin_log`; +CREATE TABLE `cnprog`.`django_admin_log` ( + `id` int(11) NOT NULL auto_increment, + `action_time` datetime NOT NULL, + `user_id` int(11) NOT NULL, + `content_type_id` int(11) default NULL, + `object_id` longtext, + `object_repr` varchar(200) NOT NULL, + `action_flag` smallint(5) unsigned NOT NULL, + `change_message` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `django_admin_log_user_id` (`user_id`), + KEY `django_admin_log_content_type_id` (`content_type_id`), + CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_admin_log` +-- +INSERT INTO `cnprog`.`django_admin_log` VALUES (1,'2008-12-18 23:41:41',2,7,'1','cnprog.com',2,'已修改 domain 和 name 。'); + +-- +-- Definition of table `cnprog`.`django_authopenid_association` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_authopenid_association`; +CREATE TABLE `cnprog`.`django_authopenid_association` ( + `id` int(11) NOT NULL auto_increment, + `server_url` longtext NOT NULL, + `handle` varchar(255) NOT NULL, + `secret` longtext NOT NULL, + `issued` int(11) NOT NULL, + `lifetime` int(11) NOT NULL, + `assoc_type` longtext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_authopenid_association` +-- +INSERT INTO `cnprog`.`django_authopenid_association` VALUES (2,'https://www.google.com/accounts/o8/ud','AOQobUfcCH4sgjsBGGscrzxIa5UM4clofAB6nixx8Qq_NWco4ynn_Kc4','u5cva43abzdwF8CJOFZfkzfk7x8=\n',1229022261,1229022261,'HMAC-SHA1'), + (3,'https://api.screenname.aol.com/auth/openidServer','diAyLjAgayAwIGJhT2VvYkdDZ21RSHJ4QldzQnhTdjIxV3BVbz0%3D-j5HRXRB1VbPyg48jGKE1Q70dfv76lGHEPwd9071%2FJ7f6SSw5YhakrwWpsVXtr34T6iHwPDdo6RU%3D','EmQL3+5oR6mFKIaeBNy6hXyUJ/w=\n',1229282202,1229282202,'HMAC-SHA1'), + (4,'https://open.login.yahooapis.com/openid/op/auth','JcBeY.uWXu2YjzbuCQiqFzAb0MIc7ATeKiPO4eAp3vluPMqZp_NCxepvMLGrJjxxDKTaNnr06wepMos8ap6SQYZiTi51tZ05lMWnpZAiOA1hsq_WMlEL7G9YE66GEA9A','QXiuN6B7E8nP5QhyHI3IB26t4SA=\n',1229282256,1229282256,'HMAC-SHA1'), + (5,'http://openid.claimid.com/server','{HMAC-SHA1}{494575fd}{uLEbxQ==}','GvPbkgMHh0QVPH7mStCGuWb2AKY=\n',1229288957,1229288957,'HMAC-SHA1'), + (6,'http://www.blogger.com/openid-server.g','oida-1229424484019-158830626','8gaU4aKnIFCLKIkHdxZQp7ZGNck=\n',1229424478,1229424478,'HMAC-SHA1'); + +-- +-- Definition of table `cnprog`.`django_authopenid_nonce` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_authopenid_nonce`; +CREATE TABLE `cnprog`.`django_authopenid_nonce` ( + `id` int(11) NOT NULL auto_increment, + `server_url` varchar(255) NOT NULL, + `timestamp` int(11) NOT NULL, + `salt` varchar(40) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=21 DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`django_authopenid_userassociation` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_authopenid_userassociation`; +CREATE TABLE `cnprog`.`django_authopenid_userassociation` ( + `id` int(11) NOT NULL auto_increment, + `openid_url` varchar(255) NOT NULL, + `user_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_163d208d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_authopenid_userassociation` +-- +INSERT INTO `cnprog`.`django_authopenid_userassociation` VALUES (2,'https://www.google.com/accounts/o8/id?id=AItOawl7CVVHl4DWtteqj4dd_A23zKRwPZgOOjw',2), + (3,'https://me.yahoo.com/a/f8f2zXF91okYL4iN2Zh4P542a5s-#f4af2',3), + (4,'https://me.yahoo.com/sailingcai#6fa4e',4); + +-- +-- Definition of table `cnprog`.`django_authopenid_userpasswordqueue` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_authopenid_userpasswordqueue`; +CREATE TABLE `cnprog`.`django_authopenid_userpasswordqueue` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `new_password` varchar(30) NOT NULL, + `confirm_key` varchar(40) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_76bcaaa4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_authopenid_userpasswordqueue` +-- + +-- +-- Definition of table `cnprog`.`django_content_type` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_content_type`; +CREATE TABLE `cnprog`.`django_content_type` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(100) NOT NULL, + `app_label` varchar(100) NOT NULL, + `model` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `app_label` (`app_label`,`model`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_content_type` +-- +INSERT INTO `cnprog`.`django_content_type` VALUES (1,'permission','auth','permission'), + (2,'group','auth','group'), + (3,'user','auth','user'), + (4,'message','auth','message'), + (5,'content type','contenttypes','contenttype'), + (6,'session','sessions','session'), + (7,'site','sites','site'), + (9,'answer','forum','answer'), + (10,'comment','forum','comment'), + (11,'tag','forum','tag'), + (13,'nonce','django_openidconsumer','nonce'), + (14,'association','django_openidconsumer','association'), + (15,'nonce','django_authopenid','nonce'), + (16,'association','django_authopenid','association'), + (17,'user association','django_authopenid','userassociation'), + (18,'user password queue','django_authopenid','userpasswordqueue'), + (19,'log entry','admin','logentry'), + (20,'question','forum','question'), + (21,'vote','forum','vote'), + (22,'flagged item','forum','flaggeditem'), + (23,'favorite question','forum','favoritequestion'), + (24,'badge','forum','badge'), + (25,'award','forum','award'); + +-- +-- Definition of table `cnprog`.`django_session` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_session`; +CREATE TABLE `cnprog`.`django_session` ( + `session_key` varchar(40) NOT NULL, + `session_data` longtext NOT NULL, + `expire_date` datetime NOT NULL, + PRIMARY KEY (`session_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`django_site` +-- + +DROP TABLE IF EXISTS `cnprog`.`django_site`; +CREATE TABLE `cnprog`.`django_site` ( + `id` int(11) NOT NULL auto_increment, + `domain` varchar(100) NOT NULL, + `name` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`django_site` +-- +INSERT INTO `cnprog`.`django_site` VALUES (1,'cnprog.com','CNProg.com'); + +-- +-- Definition of table `cnprog`.`favorite_question` +-- + +DROP TABLE IF EXISTS `cnprog`.`favorite_question`; +CREATE TABLE `cnprog`.`favorite_question` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `favorite_question_question_id` (`question_id`), + KEY `favorite_question_user_id` (`user_id`), + CONSTRAINT `question_id_refs_id_1ebe1cc3` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `user_id_refs_id_52853822` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`favorite_question` +-- + +-- +-- Definition of table `cnprog`.`flagged_item` +-- + +DROP TABLE IF EXISTS `cnprog`.`flagged_item`; +CREATE TABLE `cnprog`.`flagged_item` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `flagged_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + KEY `flagged_item_content_type_id` (`content_type_id`), + KEY `flagged_item_user_id` (`user_id`), + CONSTRAINT `content_type_id_refs_id_76e44d74` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_35e3c608` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`flagged_item` +-- + +-- +-- Definition of table `cnprog`.`question` +-- + +DROP TABLE IF EXISTS `cnprog`.`question`; +CREATE TABLE `cnprog`.`question` ( + `id` int(11) NOT NULL auto_increment, + `title` varchar(300) NOT NULL, + `author_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + `wiki` tinyint(1) NOT NULL, + `wikified_at` datetime default NULL, + `answer_accepted` tinyint(1) NOT NULL, + `closed` tinyint(1) NOT NULL, + `closed_by_id` int(11) default NULL, + `closed_at` datetime default NULL, + `close_reason` smallint(6) default NULL, + `deleted` tinyint(1) NOT NULL, + `deleted_at` datetime default NULL, + `deleted_by_id` int(11) default NULL, + `locked` tinyint(1) NOT NULL, + `locked_by_id` int(11) default NULL, + `locked_at` datetime default NULL, + `vote_up_count` int(11) NOT NULL, + `vote_down_count` int(11) NOT NULL, + `score` int(11) NOT NULL, + `answer_count` int(10) unsigned NOT NULL, + `comment_count` int(10) unsigned NOT NULL, + `view_count` int(10) unsigned NOT NULL, + `offensive_flag_count` smallint(6) NOT NULL, + `favourite_count` int(10) unsigned NOT NULL, + `last_edited_at` datetime default NULL, + `last_edited_by_id` int(11) default NULL, + `last_activity_at` datetime NOT NULL, + `last_activity_by_id` int(11) NOT NULL, + `tagnames` varchar(125) NOT NULL, + `summary` varchar(180) NOT NULL, + `html` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `question_author_id` (`author_id`), + KEY `question_closed_by_id` (`closed_by_id`), + KEY `question_deleted_by_id` (`deleted_by_id`), + KEY `question_locked_by_id` (`locked_by_id`), + KEY `question_last_edited_by_id` (`last_edited_by_id`), + KEY `question_last_activity_by_id` (`last_activity_by_id`), + CONSTRAINT `author_id_refs_id_56e9d00c` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `closed_by_id_refs_id_56e9d00c` FOREIGN KEY (`closed_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `deleted_by_id_refs_id_56e9d00c` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_activity_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_activity_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_edited_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `locked_by_id_refs_id_56e9d00c` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`question_tags` +-- + +DROP TABLE IF EXISTS `cnprog`.`question_tags`; +CREATE TABLE `cnprog`.`question_tags` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `tag_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `question_id` (`question_id`,`tag_id`), + KEY `tag_id_refs_id_43fcb953` (`tag_id`), + CONSTRAINT `question_id_refs_id_266147c6` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `tag_id_refs_id_43fcb953` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`tag` +-- + +DROP TABLE IF EXISTS `cnprog`.`tag`; +CREATE TABLE `cnprog`.`tag` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `created_by_id` int(11) NOT NULL, + `used_count` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `tag_created_by_id` (`created_by_id`), + CONSTRAINT `created_by_id_refs_id_47205d6d` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`user_badge` +-- + +DROP TABLE IF EXISTS `cnprog`.`user_badge`; +CREATE TABLE `cnprog`.`user_badge` ( + `id` int(10) unsigned NOT NULL auto_increment, + `user_id` int(10) unsigned NOT NULL, + `badge_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Definition of table `cnprog`.`user_favorite_questions` +-- + +DROP TABLE IF EXISTS `cnprog`.`user_favorite_questions`; +CREATE TABLE `cnprog`.`user_favorite_questions` ( + `id` int(10) unsigned NOT NULL auto_increment, + `user_id` int(10) unsigned NOT NULL, + `question_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`user_favorite_questions` +-- + +DROP TABLE IF EXISTS `cnprog`.`vote`; +CREATE TABLE `cnprog`.`vote` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `vote` smallint(6) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + KEY `vote_content_type_id` (`content_type_id`), + KEY `vote_user_id` (`user_id`), + CONSTRAINT `content_type_id_refs_id_50124414` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_760a4df0` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +-- +-- Dumping data for table `cnprog`.`vote` +-- + + + +/*!40101 SET SQL_MODE=@OLD_SQL_MODE */; +/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; +/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; +/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; +/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; +/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; diff --git a/sql_scripts/cnprog_new_install_2009_02_28.sql b/sql_scripts/cnprog_new_install_2009_02_28.sql new file mode 100644 index 00000000..80b9fced --- /dev/null +++ b/sql_scripts/cnprog_new_install_2009_02_28.sql @@ -0,0 +1,456 @@ +SET FOREIGN_KEY_CHECKS = 0; + +CREATE TABLE `activity` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `activity_type` smallint(6) NOT NULL, + `active_at` datetime NOT NULL, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `is_auditted` tinyint(1) default '0', + PRIMARY KEY (`id`), + KEY `activity_user_id` (`user_id`), + KEY `activity_content_type_id` (`content_type_id`) +) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=utf8; + + +CREATE TABLE `answer` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `author_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + `wiki` tinyint(1) NOT NULL, + `wikified_at` datetime default NULL, + `accepted` tinyint(1) NOT NULL, + `deleted` tinyint(1) NOT NULL, + `deleted_by_id` int(11) default NULL, + `locked` tinyint(1) NOT NULL, + `locked_by_id` int(11) default NULL, + `locked_at` datetime default NULL, + `score` int(11) NOT NULL, + `comment_count` int(10) unsigned NOT NULL, + `offensive_flag_count` smallint(6) NOT NULL, + `last_edited_at` datetime default NULL, + `last_edited_by_id` int(11) default NULL, + `html` longtext NOT NULL, + `vote_up_count` int(11) NOT NULL, + `vote_down_count` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `answer_question_id` (`question_id`), + KEY `answer_author_id` (`author_id`), + KEY `answer_deleted_by_id` (`deleted_by_id`), + KEY `answer_locked_by_id` (`locked_by_id`), + KEY `answer_last_edited_by_id` (`last_edited_by_id`), + CONSTRAINT `author_id_refs_id_192b0170` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `deleted_by_id_refs_id_192b0170` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_edited_by_id_refs_id_192b0170` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `locked_by_id_refs_id_192b0170` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `question_id_refs_id_7d6550c9` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + + +CREATE TABLE `answer_revision` ( + `id` int(11) NOT NULL auto_increment, + `answer_id` int(11) NOT NULL, + `revision` int(10) unsigned NOT NULL, + `author_id` int(11) NOT NULL, + `revised_at` datetime NOT NULL, + `summary` varchar(300) collate utf8_unicode_ci NOT NULL, + `text` longtext collate utf8_unicode_ci NOT NULL, + PRIMARY KEY (`id`), + KEY `answer_revision_answer_id` (`answer_id`), + KEY `answer_revision_author_id` (`author_id`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_group` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(80) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_group_permissions` ( + `id` int(11) NOT NULL auto_increment, + `group_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `group_id` (`group_id`,`permission_id`), + KEY `permission_id_refs_id_5886d21f` (`permission_id`), + CONSTRAINT `group_id_refs_id_3cea63fe` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), + CONSTRAINT `permission_id_refs_id_5886d21f` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_message` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `message` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `auth_message_user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_650f49a6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_permission` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL, + `content_type_id` int(11) NOT NULL, + `codename` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`codename`), + KEY `auth_permission_content_type_id` (`content_type_id`), + CONSTRAINT `content_type_id_refs_id_728de91f` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_user` ( + `id` int(11) NOT NULL auto_increment, + `username` varchar(30) NOT NULL, + `first_name` varchar(30) NOT NULL, + `last_name` varchar(30) NOT NULL, + `email` varchar(75) NOT NULL, + `password` varchar(128) NOT NULL, + `is_staff` tinyint(1) NOT NULL, + `is_active` tinyint(1) NOT NULL, + `is_superuser` tinyint(1) NOT NULL, + `last_login` datetime NOT NULL, + `date_joined` datetime NOT NULL, + `gold` smallint(6) NOT NULL default '0', + `silver` smallint(5) unsigned NOT NULL default '0', + `bronze` smallint(5) unsigned NOT NULL default '0', + `reputation` int(10) unsigned default '1', + `gravatar` varchar(128) default NULL, + `questions_per_page` smallint(5) unsigned default '10', + `last_seen` datetime default NULL, + `real_name` varchar(100) default NULL, + `website` varchar(200) default NULL, + `location` varchar(100) default NULL, + `date_of_birth` datetime default NULL, + `about` text, + PRIMARY KEY (`id`), + UNIQUE KEY `username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_user_groups` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `group_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`,`group_id`), + KEY `group_id_refs_id_f116770` (`group_id`), + CONSTRAINT `group_id_refs_id_f116770` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`), + CONSTRAINT `user_id_refs_id_7ceef80f` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `auth_user_user_permissions` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `permission_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`,`permission_id`), + KEY `permission_id_refs_id_67e79cb` (`permission_id`), + CONSTRAINT `permission_id_refs_id_67e79cb` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`), + CONSTRAINT `user_id_refs_id_dfbab7d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `award` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `badge_id` int(11) NOT NULL, + `awarded_at` datetime NOT NULL, + `notified` tinyint(1) NOT NULL, + `content_type_id` int(11) default NULL, + `object_id` int(10) default NULL, + PRIMARY KEY (`id`), + KEY `award_user_id` (`user_id`), + KEY `award_badge_id` (`badge_id`), + CONSTRAINT `badge_id_refs_id_651af0e1` FOREIGN KEY (`badge_id`) REFERENCES `badge` (`id`), + CONSTRAINT `user_id_refs_id_2d83e9b6` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; + + +CREATE TABLE `badge` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(50) NOT NULL, + `type` smallint(6) NOT NULL, + `slug` varchar(50) NOT NULL, + `description` varchar(300) NOT NULL, + `multiple` tinyint(1) NOT NULL, + `awarded_count` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`,`type`), + KEY `badge_slug` (`slug`) +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + + +CREATE TABLE `comment` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `comment` varchar(300) NOT NULL, + `added_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `comment_content_type_id` (`content_type_id`), + KEY `comment_user_id` (`user_id`), + KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + CONSTRAINT `content_type_id_refs_id_13a5866c` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_6be725e8` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_admin_log` ( + `id` int(11) NOT NULL auto_increment, + `action_time` datetime NOT NULL, + `user_id` int(11) NOT NULL, + `content_type_id` int(11) default NULL, + `object_id` longtext, + `object_repr` varchar(200) NOT NULL, + `action_flag` smallint(5) unsigned NOT NULL, + `change_message` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `django_admin_log_user_id` (`user_id`), + KEY `django_admin_log_content_type_id` (`content_type_id`), + CONSTRAINT `content_type_id_refs_id_288599e6` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_c8665aa` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_authopenid_association` ( + `id` int(11) NOT NULL auto_increment, + `server_url` longtext NOT NULL, + `handle` varchar(255) NOT NULL, + `secret` longtext NOT NULL, + `issued` int(11) NOT NULL, + `lifetime` int(11) NOT NULL, + `assoc_type` longtext NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_authopenid_nonce` ( + `id` int(11) NOT NULL auto_increment, + `server_url` varchar(255) NOT NULL, + `timestamp` int(11) NOT NULL, + `salt` varchar(40) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_authopenid_userassociation` ( + `id` int(11) NOT NULL auto_increment, + `openid_url` varchar(255) NOT NULL, + `user_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_163d208d` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_authopenid_userpasswordqueue` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `new_password` varchar(30) NOT NULL, + `confirm_key` varchar(40) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `user_id` (`user_id`), + CONSTRAINT `user_id_refs_id_76bcaaa4` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_content_type` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(100) NOT NULL, + `app_label` varchar(100) NOT NULL, + `model` varchar(100) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `app_label` (`app_label`,`model`) +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_session` ( + `session_key` varchar(40) NOT NULL, + `session_data` longtext NOT NULL, + `expire_date` datetime NOT NULL, + PRIMARY KEY (`session_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `django_site` ( + `id` int(11) NOT NULL auto_increment, + `domain` varchar(100) NOT NULL, + `name` varchar(50) NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + + +CREATE TABLE `favorite_question` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `user_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + PRIMARY KEY (`id`), + KEY `favorite_question_question_id` (`question_id`), + KEY `favorite_question_user_id` (`user_id`), + CONSTRAINT `question_id_refs_id_1ebe1cc3` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `user_id_refs_id_52853822` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + + +CREATE TABLE `flagged_item` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `flagged_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + KEY `flagged_item_content_type_id` (`content_type_id`), + KEY `flagged_item_user_id` (`user_id`), + CONSTRAINT `content_type_id_refs_id_76e44d74` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_35e3c608` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + + +CREATE TABLE `question` ( + `id` int(11) NOT NULL auto_increment, + `title` varchar(300) NOT NULL, + `author_id` int(11) NOT NULL, + `added_at` datetime NOT NULL, + `wiki` tinyint(1) NOT NULL, + `wikified_at` datetime default NULL, + `answer_accepted` tinyint(1) NOT NULL, + `closed` tinyint(1) NOT NULL, + `closed_by_id` int(11) default NULL, + `closed_at` datetime default NULL, + `close_reason` smallint(6) default NULL, + `deleted` tinyint(1) NOT NULL, + `deleted_at` datetime default NULL, + `deleted_by_id` int(11) default NULL, + `locked` tinyint(1) NOT NULL, + `locked_by_id` int(11) default NULL, + `locked_at` datetime default NULL, + `score` int(11) NOT NULL, + `answer_count` int(10) unsigned NOT NULL, + `comment_count` int(10) unsigned NOT NULL, + `view_count` int(10) unsigned NOT NULL, + `offensive_flag_count` smallint(6) NOT NULL, + `favourite_count` int(10) unsigned NOT NULL, + `last_edited_at` datetime default NULL, + `last_edited_by_id` int(11) default NULL, + `last_activity_at` datetime NOT NULL, + `last_activity_by_id` int(11) NOT NULL, + `tagnames` varchar(125) NOT NULL, + `summary` varchar(180) NOT NULL, + `html` longtext NOT NULL, + `vote_up_count` int(11) NOT NULL, + `vote_down_count` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `question_author_id` (`author_id`), + KEY `question_closed_by_id` (`closed_by_id`), + KEY `question_deleted_by_id` (`deleted_by_id`), + KEY `question_locked_by_id` (`locked_by_id`), + KEY `question_last_edited_by_id` (`last_edited_by_id`), + KEY `question_last_activity_by_id` (`last_activity_by_id`), + CONSTRAINT `author_id_refs_id_56e9d00c` FOREIGN KEY (`author_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `closed_by_id_refs_id_56e9d00c` FOREIGN KEY (`closed_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `deleted_by_id_refs_id_56e9d00c` FOREIGN KEY (`deleted_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_activity_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_activity_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `last_edited_by_id_refs_id_56e9d00c` FOREIGN KEY (`last_edited_by_id`) REFERENCES `auth_user` (`id`), + CONSTRAINT `locked_by_id_refs_id_56e9d00c` FOREIGN KEY (`locked_by_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; + + +CREATE TABLE `question_revision` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `revision` int(10) unsigned NOT NULL, + `title` varchar(300) NOT NULL, + `author_id` int(11) NOT NULL, + `revised_at` datetime NOT NULL, + `tagnames` varchar(125) NOT NULL, + `summary` varchar(300) NOT NULL, + `text` longtext NOT NULL, + PRIMARY KEY (`id`), + KEY `question_revision_question_id` (`question_id`), + KEY `question_revision_author_id` (`author_id`) +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + + +CREATE TABLE `question_tags` ( + `id` int(11) NOT NULL auto_increment, + `question_id` int(11) NOT NULL, + `tag_id` int(11) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `question_id` (`question_id`,`tag_id`), + KEY `tag_id_refs_id_43fcb953` (`tag_id`), + CONSTRAINT `question_id_refs_id_266147c6` FOREIGN KEY (`question_id`) REFERENCES `question` (`id`), + CONSTRAINT `tag_id_refs_id_43fcb953` FOREIGN KEY (`tag_id`) REFERENCES `tag` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; + + +CREATE TABLE `repute` ( + `id` int(11) NOT NULL auto_increment, + `user_id` int(11) NOT NULL, + `positive` smallint(6) NOT NULL, + `negative` smallint(6) NOT NULL, + `question_id` int(11) NOT NULL, + `reputed_at` datetime NOT NULL, + `reputation_type` smallint(6) NOT NULL, + `reputation` int(11) NOT NULL, + PRIMARY KEY (`id`), + KEY `repute_user_id` (`user_id`), + KEY `repute_question_id` (`question_id`) +) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=utf8; + + +CREATE TABLE `tag` ( + `id` int(11) NOT NULL auto_increment, + `name` varchar(255) NOT NULL, + `created_by_id` int(11) NOT NULL, + `used_count` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `name` (`name`), + KEY `tag_created_by_id` (`created_by_id`), + CONSTRAINT `created_by_id_refs_id_47205d6d` FOREIGN KEY (`created_by_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; + + +CREATE TABLE `user_badge` ( + `id` int(10) unsigned NOT NULL auto_increment, + `user_id` int(10) unsigned NOT NULL, + `badge_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `user_favorite_questions` ( + `id` int(10) unsigned NOT NULL auto_increment, + `user_id` int(10) unsigned NOT NULL, + `question_id` int(10) unsigned NOT NULL, + PRIMARY KEY (`id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + + +CREATE TABLE `vote` ( + `id` int(11) NOT NULL auto_increment, + `content_type_id` int(11) NOT NULL, + `object_id` int(10) unsigned NOT NULL, + `user_id` int(11) NOT NULL, + `vote` smallint(6) NOT NULL, + `voted_at` datetime NOT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `content_type_id` (`content_type_id`,`object_id`,`user_id`), + KEY `vote_content_type_id` (`content_type_id`), + KEY `vote_user_id` (`user_id`), + CONSTRAINT `content_type_id_refs_id_50124414` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`), + CONSTRAINT `user_id_refs_id_760a4df0` FOREIGN KEY (`user_id`) REFERENCES `auth_user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/sql_scripts/cnprog_new_install_2009_03_31.sql b/sql_scripts/cnprog_new_install_2009_03_31.sql new file mode 100644 index 00000000..c2c69f36 --- /dev/null +++ b/sql_scripts/cnprog_new_install_2009_03_31.sql @@ -0,0 +1,891 @@ +USE cnprog; + + +/************ Update: Tables ***************/ + +/******************** Add Table: activity ************************/ + +/* Build Table Structure */ +CREATE TABLE activity +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + activity_type SMALLINT NOT NULL, + active_at DATETIME NOT NULL, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + is_auditted TINYINT NULL DEFAULT 0 +) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1; + +/* Table Items: activity */ + +/* Add Indexes for: activity */ +CREATE INDEX activity_content_type_id ON activity (content_type_id); +CREATE INDEX activity_user_id ON activity (user_id); + +/******************** Add Table: answer ************************/ + +/* Build Table Structure */ +CREATE TABLE answer +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + author_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + wiki TINYINT NOT NULL, + wikified_at DATETIME NULL, + accepted TINYINT NOT NULL, + deleted TINYINT NOT NULL, + deleted_by_id INTEGER NULL, + locked TINYINT NOT NULL, + locked_by_id INTEGER NULL, + locked_at DATETIME NULL, + score INTEGER NOT NULL, + comment_count INTEGER UNSIGNED NOT NULL, + offensive_flag_count SMALLINT NOT NULL, + last_edited_at DATETIME NULL, + last_edited_by_id INTEGER NULL, + html LONGTEXT NOT NULL, + vote_up_count INTEGER NOT NULL, + vote_down_count INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + +/* Table Items: answer */ + +/* Add Indexes for: answer */ +CREATE INDEX answer_author_id ON answer (author_id); +CREATE INDEX answer_deleted_by_id ON answer (deleted_by_id); +CREATE INDEX answer_last_edited_by_id ON answer (last_edited_by_id); +CREATE INDEX answer_locked_by_id ON answer (locked_by_id); +CREATE INDEX answer_question_id ON answer (question_id); + +/******************** Add Table: answer_revision ************************/ + +/* Build Table Structure */ +CREATE TABLE answer_revision +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + answer_id INTEGER NOT NULL, + revision INTEGER UNSIGNED NOT NULL, + author_id INTEGER NOT NULL, + revised_at DATETIME NOT NULL, + summary TEXT NOT NULL, + `text` LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +/* Table Items: answer_revision */ + +/* Add Indexes for: answer_revision */ +CREATE INDEX answer_revision_answer_id ON answer_revision (answer_id); +CREATE INDEX answer_revision_author_id ON answer_revision (author_id); + +/******************** Add Table: auth_group ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_group +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(80) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_group */ + +/* Add Indexes for: auth_group */ +CREATE UNIQUE INDEX name ON auth_group (name); + +/******************** Add Table: auth_group_permissions ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_group_permissions +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + group_id INTEGER NOT NULL, + permission_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_group_permissions */ + +/* Add Indexes for: auth_group_permissions */ +CREATE UNIQUE INDEX group_id ON auth_group_permissions (group_id, permission_id); +CREATE INDEX permission_id_refs_id_5886d21f ON auth_group_permissions (permission_id); + +/******************** Add Table: auth_message ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_message +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + message LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; + +/* Table Items: auth_message */ + +/* Add Indexes for: auth_message */ +CREATE INDEX auth_message_user_id ON auth_message (user_id); + +/******************** Add Table: auth_permission ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_permission +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + content_type_id INTEGER NOT NULL, + codename VARCHAR(100) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; + +/* Table Items: auth_permission */ + +/* Add Indexes for: auth_permission */ +CREATE INDEX auth_permission_content_type_id ON auth_permission (content_type_id); +CREATE UNIQUE INDEX content_type_id ON auth_permission (content_type_id, codename); + +/******************** Add Table: auth_user ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(30) NOT NULL, + first_name VARCHAR(30) NOT NULL, + last_name VARCHAR(30) NOT NULL, + email VARCHAR(75) NOT NULL, + password VARCHAR(128) NOT NULL, + is_staff TINYINT NOT NULL, + is_active TINYINT NOT NULL, + is_superuser TINYINT NOT NULL, + last_login DATETIME NOT NULL, + date_joined DATETIME NOT NULL, + gold SMALLINT NOT NULL DEFAULT 0, + silver SMALLINT UNSIGNED NOT NULL DEFAULT 0, + bronze SMALLINT UNSIGNED NOT NULL DEFAULT 0, + reputation INTEGER UNSIGNED NULL DEFAULT 1, + gravatar VARCHAR(128) NULL, + questions_per_page SMALLINT UNSIGNED NULL DEFAULT 10, + last_seen DATETIME NULL, + real_name VARCHAR(100) NULL, + website VARCHAR(200) NULL, + location VARCHAR(100) NULL, + date_of_birth DATETIME NULL, + about TEXT NULL +) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; + +/* Table Items: auth_user */ + +/* Add Indexes for: auth_user */ +CREATE UNIQUE INDEX username ON auth_user (username); + +/******************** Add Table: auth_user_groups ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user_groups +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + group_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_user_groups */ + +/* Add Indexes for: auth_user_groups */ +CREATE INDEX group_id_refs_id_f116770 ON auth_user_groups (group_id); +CREATE UNIQUE INDEX user_id ON auth_user_groups (user_id, group_id); + +/******************** Add Table: auth_user_user_permissions ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user_user_permissions +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + permission_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_user_user_permissions */ + +/* Add Indexes for: auth_user_user_permissions */ +CREATE INDEX permission_id_refs_id_67e79cb ON auth_user_user_permissions (permission_id); +CREATE UNIQUE INDEX user_id ON auth_user_user_permissions (user_id, permission_id); + +/******************** Add Table: award ************************/ + +/* Build Table Structure */ +CREATE TABLE award +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + badge_id INTEGER NOT NULL, + awarded_at DATETIME NOT NULL, + notified TINYINT NOT NULL, + content_type_id INTEGER NULL, + object_id INTEGER NULL +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; + +/* Table Items: award */ + +/* Add Indexes for: award */ +CREATE INDEX award_badge_id ON award (badge_id); +CREATE INDEX award_user_id ON award (user_id); + +/******************** Add Table: badge ************************/ + +/* Build Table Structure */ +CREATE TABLE badge +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + `type` SMALLINT NOT NULL, + slug VARCHAR(50) NOT NULL, + description TEXT NOT NULL, + multiple TINYINT NOT NULL, + awarded_count INTEGER UNSIGNED NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + +/* Table Items: badge */ + +/* Add Indexes for: badge */ +CREATE INDEX badge_slug ON badge (slug); +CREATE UNIQUE INDEX name ON badge (name, `type`); + +/******************** Add Table: book ************************/ + +/* Build Table Structure */ +CREATE TABLE book +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + short_name VARCHAR(255) NOT NULL, + author VARCHAR(255) NOT NULL, + user_id INTEGER NULL, + price DECIMAL(10, 2) NULL, + pages SMALLINT NULL, + published_at DATE NOT NULL, + publication VARCHAR(255) NOT NULL, + cover_img VARCHAR(255) NULL, + tagnames VARCHAR(125) NULL, + added_at DATETIME NOT NULL, + last_edited_at DATETIME NOT NULL +) TYPE=InnoDB; + +/* Table Items: book */ + +/* Add Indexes for: book */ +CREATE UNIQUE INDEX book_short_name_Idx ON book (short_name); +CREATE INDEX fk_books_auth_user ON book (user_id); + +/******************** Add Table: book_author_info ************************/ + +/* Build Table Structure */ +CREATE TABLE book_author_info +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + blog_url VARCHAR(255) NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + last_edited_at DATETIME NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_author_info */ + +/* Add Indexes for: book_author_info */ +CREATE INDEX fk_book_author_info_auth_user ON book_author_info (user_id); + +/******************** Add Table: book_author_rss ************************/ + +/* Build Table Structure */ +CREATE TABLE book_author_rss +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + url VARCHAR(255) NOT NULL, + rss_created_at DATETIME NOT NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_author_rss */ + +/* Add Indexes for: book_author_rss */ +CREATE INDEX fk_book_author_rss_auth_user ON book_author_rss (user_id); + +/******************** Add Table: book_question ************************/ + +/* Build Table Structure */ +CREATE TABLE book_question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + book_id INTEGER NOT NULL, + question_id INTEGER NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_question */ + +/* Add Indexes for: book_question */ +CREATE INDEX fk_book_question_book ON book_question (book_id); +CREATE INDEX fk_book_question_question ON book_question (question_id); + +/******************** Add Table: `comment` ************************/ + +/* Build Table Structure */ +CREATE TABLE `comment` +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + `comment` TEXT NOT NULL, + added_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; + +/* Table Items: `comment` */ + +/* Add Indexes for: comment */ +CREATE INDEX comment_content_type_id ON `comment` (content_type_id); +CREATE INDEX comment_user_id ON `comment` (user_id); +CREATE INDEX content_type_id ON `comment` (content_type_id, object_id, user_id); + +/******************** Add Table: django_admin_log ************************/ + +/* Build Table Structure */ +CREATE TABLE django_admin_log +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + action_time DATETIME NOT NULL, + user_id INTEGER NOT NULL, + content_type_id INTEGER NULL, + object_id LONGTEXT NULL, + object_repr VARCHAR(200) NOT NULL, + action_flag SMALLINT UNSIGNED NOT NULL, + change_message LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +/* Table Items: django_admin_log */ + +/* Add Indexes for: django_admin_log */ +CREATE INDEX django_admin_log_content_type_id ON django_admin_log (content_type_id); +CREATE INDEX django_admin_log_user_id ON django_admin_log (user_id); + +/******************** Add Table: django_authopenid_association ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_association +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + server_url LONGTEXT NOT NULL, + handle VARCHAR(255) NOT NULL, + secret LONGTEXT NOT NULL, + issued INTEGER NOT NULL, + lifetime INTEGER NOT NULL, + assoc_type LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + +/******************** Add Table: django_authopenid_nonce ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_nonce +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + server_url VARCHAR(255) NOT NULL, + `timestamp` INTEGER NOT NULL, + salt VARCHAR(40) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; + +/******************** Add Table: django_authopenid_userassociation ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_userassociation +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + openid_url VARCHAR(255) NOT NULL, + user_id INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +/* Table Items: django_authopenid_userassociation */ + +/* Add Indexes for: django_authopenid_userassociation */ +CREATE UNIQUE INDEX user_id ON django_authopenid_userassociation (user_id); + +/******************** Add Table: django_authopenid_userpasswordqueue ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_userpasswordqueue +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + new_password VARCHAR(30) NOT NULL, + confirm_key VARCHAR(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: django_authopenid_userpasswordqueue */ + +/* Add Indexes for: django_authopenid_userpasswordqueue */ +CREATE UNIQUE INDEX user_id ON django_authopenid_userpasswordqueue (user_id); + +/******************** Add Table: django_content_type ************************/ + +/* Build Table Structure */ +CREATE TABLE django_content_type +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + app_label VARCHAR(100) NOT NULL, + model VARCHAR(100) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; + +/* Table Items: django_content_type */ + +/* Add Indexes for: django_content_type */ +CREATE UNIQUE INDEX app_label ON django_content_type (app_label, model); + +/******************** Add Table: django_session ************************/ + +/* Build Table Structure */ +CREATE TABLE django_session +( + session_key VARCHAR(40) NOT NULL, + session_data LONGTEXT NOT NULL, + expire_date DATETIME NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: django_session */ +ALTER TABLE django_session ADD CONSTRAINT pkdjango_session + PRIMARY KEY (session_key); + +/******************** Add Table: django_site ************************/ + +/* Build Table Structure */ +CREATE TABLE django_site +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + domain VARCHAR(100) NOT NULL, + name VARCHAR(50) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +/******************** Add Table: favorite_question ************************/ + +/* Build Table Structure */ +CREATE TABLE favorite_question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +/* Table Items: favorite_question */ + +/* Add Indexes for: favorite_question */ +CREATE INDEX favorite_question_question_id ON favorite_question (question_id); +CREATE INDEX favorite_question_user_id ON favorite_question (user_id); + +/******************** Add Table: flagged_item ************************/ + +/* Build Table Structure */ +CREATE TABLE flagged_item +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + flagged_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + +/* Table Items: flagged_item */ + +/* Add Indexes for: flagged_item */ +CREATE UNIQUE INDEX content_type_id ON flagged_item (content_type_id, object_id, user_id); +CREATE INDEX flagged_item_content_type_id ON flagged_item (content_type_id); +CREATE INDEX flagged_item_user_id ON flagged_item (user_id); + +/******************** Add Table: question ************************/ + +/* Build Table Structure */ +CREATE TABLE question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title TEXT NOT NULL, + author_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + wiki TINYINT NOT NULL, + wikified_at DATETIME NULL, + answer_accepted TINYINT NOT NULL, + closed TINYINT NOT NULL, + closed_by_id INTEGER NULL, + closed_at DATETIME NULL, + close_reason SMALLINT NULL, + deleted TINYINT NOT NULL, + deleted_at DATETIME NULL, + deleted_by_id INTEGER NULL, + locked TINYINT NOT NULL, + locked_by_id INTEGER NULL, + locked_at DATETIME NULL, + score INTEGER NOT NULL, + answer_count INTEGER UNSIGNED NOT NULL, + comment_count INTEGER UNSIGNED NOT NULL, + view_count INTEGER UNSIGNED NOT NULL, + offensive_flag_count SMALLINT NOT NULL, + favourite_count INTEGER UNSIGNED NOT NULL, + last_edited_at DATETIME NULL, + last_edited_by_id INTEGER NULL, + last_activity_at DATETIME NOT NULL, + last_activity_by_id INTEGER NOT NULL, + tagnames VARCHAR(125) NOT NULL, + summary VARCHAR(180) NOT NULL, + html LONGTEXT NOT NULL, + vote_up_count INTEGER NOT NULL, + vote_down_count INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; + +/* Table Items: question */ + +/* Add Indexes for: question */ +CREATE INDEX question_author_id ON question (author_id); +CREATE INDEX question_closed_by_id ON question (closed_by_id); +CREATE INDEX question_deleted_by_id ON question (deleted_by_id); +CREATE INDEX question_last_activity_by_id ON question (last_activity_by_id); +CREATE INDEX question_last_edited_by_id ON question (last_edited_by_id); +CREATE INDEX question_locked_by_id ON question (locked_by_id); + +/******************** Add Table: question_revision ************************/ + +/* Build Table Structure */ +CREATE TABLE question_revision +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + revision INTEGER UNSIGNED NOT NULL, + title TEXT NOT NULL, + author_id INTEGER NOT NULL, + revised_at DATETIME NOT NULL, + tagnames VARCHAR(125) NOT NULL, + summary TEXT NOT NULL, + `text` LONGTEXT NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +/* Table Items: question_revision */ + +/* Add Indexes for: question_revision */ +CREATE INDEX question_revision_author_id ON question_revision (author_id); +CREATE INDEX question_revision_question_id ON question_revision (question_id); + +/******************** Add Table: question_tags ************************/ + +/* Build Table Structure */ +CREATE TABLE question_tags +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + tag_id INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; + +/* Table Items: question_tags */ + +/* Add Indexes for: question_tags */ +CREATE UNIQUE INDEX question_id ON question_tags (question_id, tag_id); +CREATE INDEX tag_id_refs_id_43fcb953 ON question_tags (tag_id); + +/******************** Add Table: repute ************************/ + +/* Build Table Structure */ +CREATE TABLE repute +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + positive SMALLINT NOT NULL, + negative SMALLINT NOT NULL, + question_id INTEGER NOT NULL, + reputed_at DATETIME NOT NULL, + reputation_type SMALLINT NOT NULL, + reputation INTEGER NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; + +/* Table Items: repute */ + +/* Add Indexes for: repute */ +CREATE INDEX repute_question_id ON repute (question_id); +CREATE INDEX repute_user_id ON repute (user_id); + +/******************** Add Table: tag ************************/ + +/* Build Table Structure */ +CREATE TABLE tag +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + created_by_id INTEGER NOT NULL, + used_count INTEGER UNSIGNED NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; + +/* Table Items: tag */ + +/* Add Indexes for: tag */ +CREATE UNIQUE INDEX name ON tag (name); +CREATE INDEX tag_created_by_id ON tag (created_by_id); + +/******************** Add Table: user_badge ************************/ + +/* Build Table Structure */ +CREATE TABLE user_badge +( + id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + badge_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: user_badge */ + +/* Add Indexes for: user_badge */ +CREATE INDEX fk_user_badge_auth_user ON user_badge (user_id); +CREATE INDEX fk_user_badge_badge ON user_badge (badge_id); + +/******************** Add Table: user_favorite_questions ************************/ + +/* Build Table Structure */ +CREATE TABLE user_favorite_questions +( + id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + question_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: user_favorite_questions */ + +/* Add Indexes for: user_favorite_questions */ +CREATE INDEX fk_user_favorite_questions_auth_user ON user_favorite_questions (user_id); +CREATE INDEX fk_user_favorite_questions_question ON user_favorite_questions (question_id); + +/******************** Add Table: vote ************************/ + +/* Build Table Structure */ +CREATE TABLE vote +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + vote SMALLINT NOT NULL, + voted_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +/* Table Items: vote */ + +/* Add Indexes for: vote */ +CREATE UNIQUE INDEX content_type_id ON vote (content_type_id, object_id, user_id); +CREATE INDEX vote_content_type_id ON vote (content_type_id); +CREATE INDEX vote_user_id ON vote (user_id); + + +/************ Add Foreign Keys to Database ***************/ +/*----------------------------------------------------------- +Warning: Versions of MySQL prior to 4.1.2 require indexes on all columns involved in a foreign key. The following indexes may be required: +fk_auth_group_permissions_auth_group may require an index on table: auth_group_permissions, column: group_id +fk_auth_user_groups_auth_user may require an index on table: auth_user_groups, column: user_id +fk_auth_user_user_permissions_auth_user may require an index on table: auth_user_user_permissions, column: user_id +fk_question_tags_question may require an index on table: question_tags, column: question_id +----------------------------------------------------------- +*/ + +/************ 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: deleted_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT deleted_by_id_refs_id_192b0170 + FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_auth_user ***************/ +ALTER TABLE answer ADD CONSTRAINT fk_answer_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_question ***************/ +ALTER TABLE answer ADD CONSTRAINT fk_answer_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_edited_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT last_edited_by_id_refs_id_192b0170 + FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: locked_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT locked_by_id_refs_id_192b0170 + FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_revision_auth_user ***************/ +ALTER TABLE answer_revision ADD CONSTRAINT fk_answer_revision_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_group_permissions_auth_group ***************/ +ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_group + FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_group_permissions_auth_permission ***************/ +ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_permission + FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_message_auth_user ***************/ +ALTER TABLE auth_message ADD CONSTRAINT fk_auth_message_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_permission_django_content_type ***************/ +ALTER TABLE auth_permission ADD CONSTRAINT fk_auth_permission_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_groups_auth_group ***************/ +ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_group + FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_groups_auth_user ***************/ +ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_user_permissions_auth_permission ***************/ +ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_permission + FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_user_permissions_auth_user ***************/ +ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_award_auth_user ***************/ +ALTER TABLE award ADD CONSTRAINT fk_award_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_award_badge ***************/ +ALTER TABLE award ADD CONSTRAINT fk_award_badge + FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_books_auth_user ***************/ +ALTER TABLE book ADD CONSTRAINT fk_books_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_info_auth_user ***************/ +ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_rss_auth_user ***************/ +ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_question_book ***************/ +ALTER TABLE book_question ADD CONSTRAINT fk_book_question_book + FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_question_question ***************/ +ALTER TABLE book_question ADD CONSTRAINT fk_book_question_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_comment_auth_user ***************/ +ALTER TABLE `comment` ADD CONSTRAINT fk_comment_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_comment_django_content_type ***************/ +ALTER TABLE `comment` ADD CONSTRAINT fk_comment_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_admin_log_auth_user ***************/ +ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_admin_log_django_content_type ***************/ +ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_authopenid_userassociation_auth_user ***************/ +ALTER TABLE django_authopenid_userassociation ADD CONSTRAINT fk_django_authopenid_userassociation_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_authopenid_userpasswordqueue_auth_user ***************/ +ALTER TABLE django_authopenid_userpasswordqueue ADD CONSTRAINT fk_django_authopenid_userpasswordqueue_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_favorite_question_auth_user ***************/ +ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_favorite_question_question ***************/ +ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_flagged_item_auth_user ***************/ +ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_flagged_item_django_content_type ***************/ +ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: closed_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT closed_by_id_refs_id_56e9d00c + FOREIGN KEY (closed_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: deleted_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT deleted_by_id_refs_id_56e9d00c + FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_question_auth_user ***************/ +ALTER TABLE question ADD CONSTRAINT fk_question_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_activity_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT last_activity_by_id_refs_id_56e9d00c + FOREIGN KEY (last_activity_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_edited_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT last_edited_by_id_refs_id_56e9d00c + FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: locked_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT locked_by_id_refs_id_56e9d00c + FOREIGN KEY (locked_by_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_question_tags_question ***************/ +ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_question_tags_tag ***************/ +ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_tag + FOREIGN KEY (tag_id) REFERENCES tag (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; + +/************ Foreign Key: fk_tag_auth_user ***************/ +ALTER TABLE tag ADD CONSTRAINT fk_tag_auth_user + FOREIGN KEY (created_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_badge_auth_user ***************/ +ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_badge_badge ***************/ +ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_badge + FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_favorite_questions_auth_user ***************/ +ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_favorite_questions_question ***************/ +ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_vote_auth_user ***************/ +ALTER TABLE vote ADD CONSTRAINT fk_vote_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_vote_django_content_type ***************/ +ALTER TABLE vote ADD CONSTRAINT fk_vote_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
\ No newline at end of file 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 diff --git a/sql_scripts/cnprog_new_install_2009_04_09.sql b/sql_scripts/cnprog_new_install_2009_04_09.sql new file mode 100644 index 00000000..f4424852 --- /dev/null +++ b/sql_scripts/cnprog_new_install_2009_04_09.sql @@ -0,0 +1,904 @@ +USE cnprog; + + +/************ Update: Tables ***************/ + +/******************** Add Table: activity ************************/ + +/* Build Table Structure */ +CREATE TABLE activity +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + activity_type SMALLINT NOT NULL, + active_at DATETIME NOT NULL, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + is_auditted TINYINT NULL DEFAULT 0 +) ENGINE=MyISAM AUTO_INCREMENT=103 DEFAULT CHARSET=latin1; + +/* Table Items: activity */ + +/* Add Indexes for: activity */ +CREATE INDEX activity_content_type_id ON activity (content_type_id); +CREATE INDEX activity_user_id ON activity (user_id); + +/******************** Add Table: answer ************************/ + +/* Build Table Structure */ +CREATE TABLE answer +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + author_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + wiki TINYINT NOT NULL, + wikified_at DATETIME NULL, + accepted TINYINT NOT NULL, + deleted TINYINT NOT NULL, + deleted_by_id INTEGER NULL, + locked TINYINT NOT NULL, + locked_by_id INTEGER NULL, + locked_at DATETIME NULL, + score INTEGER NOT NULL, + comment_count INTEGER UNSIGNED NOT NULL, + offensive_flag_count SMALLINT NOT NULL, + last_edited_at DATETIME NULL, + last_edited_by_id INTEGER NULL, + html LONGTEXT NOT NULL, + vote_up_count INTEGER NOT NULL, + vote_down_count INTEGER NOT NULL, + accepted_at DATETIME NULL +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + +/* Table Items: answer */ + +/* Add Indexes for: answer */ +CREATE INDEX answer_author_id ON answer (author_id); +CREATE INDEX answer_deleted_by_id ON answer (deleted_by_id); +CREATE INDEX answer_last_edited_by_id ON answer (last_edited_by_id); +CREATE INDEX answer_locked_by_id ON answer (locked_by_id); +CREATE INDEX answer_question_id ON answer (question_id); + +/******************** Add Table: answer_revision ************************/ + +/* Build Table Structure */ +CREATE TABLE answer_revision +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + answer_id INTEGER NOT NULL, + revision INTEGER UNSIGNED NOT NULL, + author_id INTEGER NOT NULL, + revised_at DATETIME NOT NULL, + summary TEXT NOT NULL, + `text` LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci; + +/* Table Items: answer_revision */ + +/* Add Indexes for: answer_revision */ +CREATE INDEX answer_revision_answer_id ON answer_revision (answer_id); +CREATE INDEX answer_revision_author_id ON answer_revision (author_id); + +/******************** Add Table: auth_group ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_group +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(80) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_group */ + +/* Add Indexes for: auth_group */ +CREATE UNIQUE INDEX name ON auth_group (name); + +/******************** Add Table: auth_group_permissions ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_group_permissions +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + group_id INTEGER NOT NULL, + permission_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_group_permissions */ + +/* Add Indexes for: auth_group_permissions */ +CREATE UNIQUE INDEX group_id ON auth_group_permissions (group_id, permission_id); +CREATE INDEX permission_id_refs_id_5886d21f ON auth_group_permissions (permission_id); + +/******************** Add Table: auth_message ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_message +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + message LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=33 DEFAULT CHARSET=utf8; + +/* Table Items: auth_message */ + +/* Add Indexes for: auth_message */ +CREATE INDEX auth_message_user_id ON auth_message (user_id); + +/******************** Add Table: auth_permission ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_permission +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + content_type_id INTEGER NOT NULL, + codename VARCHAR(100) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=88 DEFAULT CHARSET=utf8; + +/* Table Items: auth_permission */ + +/* Add Indexes for: auth_permission */ +CREATE INDEX auth_permission_content_type_id ON auth_permission (content_type_id); +CREATE UNIQUE INDEX content_type_id ON auth_permission (content_type_id, codename); + +/******************** Add Table: auth_user ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + username VARCHAR(30) NOT NULL, + first_name VARCHAR(30) NOT NULL, + last_name VARCHAR(30) NOT NULL, + email VARCHAR(75) NOT NULL, + password VARCHAR(128) NOT NULL, + is_staff TINYINT NOT NULL, + is_active TINYINT NOT NULL, + is_superuser TINYINT NOT NULL, + last_login DATETIME NOT NULL, + date_joined DATETIME NOT NULL, + gold SMALLINT NOT NULL DEFAULT 0, + silver SMALLINT UNSIGNED NOT NULL DEFAULT 0, + bronze SMALLINT UNSIGNED NOT NULL DEFAULT 0, + reputation INTEGER UNSIGNED NULL DEFAULT 1, + gravatar VARCHAR(128) NULL, + questions_per_page SMALLINT UNSIGNED NULL DEFAULT 10, + last_seen DATETIME NULL, + real_name VARCHAR(100) NULL, + website VARCHAR(200) NULL, + location VARCHAR(100) NULL, + date_of_birth DATETIME NULL, + about TEXT NULL +) ENGINE=InnoDB AUTO_INCREMENT=104 DEFAULT CHARSET=utf8; + +/* Table Items: auth_user */ + +/* Add Indexes for: auth_user */ +CREATE UNIQUE INDEX username ON auth_user (username); + +/******************** Add Table: auth_user_groups ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user_groups +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + group_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_user_groups */ + +/* Add Indexes for: auth_user_groups */ +CREATE INDEX group_id_refs_id_f116770 ON auth_user_groups (group_id); +CREATE UNIQUE INDEX user_id ON auth_user_groups (user_id, group_id); + +/******************** Add Table: auth_user_user_permissions ************************/ + +/* Build Table Structure */ +CREATE TABLE auth_user_user_permissions +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + permission_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: auth_user_user_permissions */ + +/* Add Indexes for: auth_user_user_permissions */ +CREATE INDEX permission_id_refs_id_67e79cb ON auth_user_user_permissions (permission_id); +CREATE UNIQUE INDEX user_id ON auth_user_user_permissions (user_id, permission_id); + +/******************** Add Table: award ************************/ + +/* Build Table Structure */ +CREATE TABLE award +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + badge_id INTEGER NOT NULL, + awarded_at DATETIME NOT NULL, + notified TINYINT NOT NULL, + content_type_id INTEGER NULL, + object_id INTEGER NULL +) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8; + +/* Table Items: award */ + +/* Add Indexes for: award */ +CREATE INDEX award_badge_id ON award (badge_id); +CREATE INDEX award_user_id ON award (user_id); + +/******************** Add Table: badge ************************/ + +/* Build Table Structure */ +CREATE TABLE badge +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(50) NOT NULL, + `type` SMALLINT NOT NULL, + slug VARCHAR(50) NOT NULL, + description TEXT NOT NULL, + multiple TINYINT NOT NULL, + awarded_count INTEGER UNSIGNED NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=37 DEFAULT CHARSET=utf8; + +/* Table Items: badge */ + +/* Add Indexes for: badge */ +CREATE INDEX badge_slug ON badge (slug); +CREATE UNIQUE INDEX name ON badge (name, `type`); + +/******************** Add Table: book ************************/ + +/* Build Table Structure */ +CREATE TABLE book +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + short_name VARCHAR(255) NOT NULL, + author VARCHAR(255) NOT NULL, + user_id INTEGER NULL, + price DECIMAL(10, 2) NULL, + pages SMALLINT NULL, + published_at DATE NOT NULL, + publication VARCHAR(255) NOT NULL, + cover_img VARCHAR(255) NULL, + tagnames VARCHAR(125) NULL, + added_at DATETIME NOT NULL, + last_edited_at DATETIME NOT NULL +) TYPE=InnoDB; + +/* Table Items: book */ + +/* Add Indexes for: book */ +CREATE UNIQUE INDEX book_short_name_Idx ON book (short_name); +CREATE INDEX fk_books_auth_user ON book (user_id); + +/******************** Add Table: book_author_info ************************/ + +/* Build Table Structure */ +CREATE TABLE book_author_info +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + blog_url VARCHAR(255) NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + last_edited_at DATETIME NOT NULL, + book_id INTEGER NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_author_info */ + +/* Add Indexes for: book_author_info */ +CREATE INDEX fk_book_author_info_auth_user ON book_author_info (user_id); +CREATE INDEX fk_book_author_info_book ON book_author_info (book_id); + +/******************** Add Table: book_author_rss ************************/ + +/* Build Table Structure */ +CREATE TABLE book_author_rss +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title VARCHAR(255) NOT NULL, + url VARCHAR(255) NOT NULL, + rss_created_at DATETIME NOT NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + book_id INTEGER NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_author_rss */ + +/* Add Indexes for: book_author_rss */ +CREATE INDEX fk_book_author_rss_auth_user ON book_author_rss (user_id); +CREATE INDEX fk_book_author_rss_book ON book_author_rss (book_id); + +/******************** Add Table: book_question ************************/ + +/* Build Table Structure */ +CREATE TABLE book_question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + book_id INTEGER NOT NULL, + question_id INTEGER NOT NULL +) TYPE=InnoDB; + +/* Table Items: book_question */ + +/* Add Indexes for: book_question */ +CREATE INDEX fk_book_question_book ON book_question (book_id); +CREATE INDEX fk_book_question_question ON book_question (question_id); + +/******************** Add Table: `comment` ************************/ + +/* Build Table Structure */ +CREATE TABLE `comment` +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + `comment` TEXT NOT NULL, + added_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=23 DEFAULT CHARSET=utf8; + +/* Table Items: `comment` */ + +/* Add Indexes for: comment */ +CREATE INDEX comment_content_type_id ON `comment` (content_type_id); +CREATE INDEX comment_user_id ON `comment` (user_id); +CREATE INDEX content_type_id ON `comment` (content_type_id, object_id, user_id); + +/******************** Add Table: django_admin_log ************************/ + +/* Build Table Structure */ +CREATE TABLE django_admin_log +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + action_time DATETIME NOT NULL, + user_id INTEGER NOT NULL, + content_type_id INTEGER NULL, + object_id LONGTEXT NULL, + object_repr VARCHAR(200) NOT NULL, + action_flag SMALLINT UNSIGNED NOT NULL, + change_message LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +/* Table Items: django_admin_log */ + +/* Add Indexes for: django_admin_log */ +CREATE INDEX django_admin_log_content_type_id ON django_admin_log (content_type_id); +CREATE INDEX django_admin_log_user_id ON django_admin_log (user_id); + +/******************** Add Table: django_authopenid_association ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_association +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + server_url LONGTEXT NOT NULL, + handle VARCHAR(255) NOT NULL, + secret LONGTEXT NOT NULL, + issued INTEGER NOT NULL, + lifetime INTEGER NOT NULL, + assoc_type LONGTEXT NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + +/******************** Add Table: django_authopenid_nonce ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_nonce +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + server_url VARCHAR(255) NOT NULL, + `timestamp` INTEGER NOT NULL, + salt VARCHAR(40) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=24 DEFAULT CHARSET=utf8; + +/******************** Add Table: django_authopenid_userassociation ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_userassociation +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + openid_url VARCHAR(255) NOT NULL, + user_id INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +/* Table Items: django_authopenid_userassociation */ + +/* Add Indexes for: django_authopenid_userassociation */ +CREATE UNIQUE INDEX user_id ON django_authopenid_userassociation (user_id); + +/******************** Add Table: django_authopenid_userpasswordqueue ************************/ + +/* Build Table Structure */ +CREATE TABLE django_authopenid_userpasswordqueue +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + new_password VARCHAR(30) NOT NULL, + confirm_key VARCHAR(40) NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: django_authopenid_userpasswordqueue */ + +/* Add Indexes for: django_authopenid_userpasswordqueue */ +CREATE UNIQUE INDEX user_id ON django_authopenid_userpasswordqueue (user_id); + +/******************** Add Table: django_content_type ************************/ + +/* Build Table Structure */ +CREATE TABLE django_content_type +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(100) NOT NULL, + app_label VARCHAR(100) NOT NULL, + model VARCHAR(100) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=30 DEFAULT CHARSET=utf8; + +/* Table Items: django_content_type */ + +/* Add Indexes for: django_content_type */ +CREATE UNIQUE INDEX app_label ON django_content_type (app_label, model); + +/******************** Add Table: django_session ************************/ + +/* Build Table Structure */ +CREATE TABLE django_session +( + session_key VARCHAR(40) NOT NULL, + session_data LONGTEXT NOT NULL, + expire_date DATETIME NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: django_session */ +ALTER TABLE django_session ADD CONSTRAINT pkdjango_session + PRIMARY KEY (session_key); + +/******************** Add Table: django_site ************************/ + +/* Build Table Structure */ +CREATE TABLE django_site +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + domain VARCHAR(100) NOT NULL, + name VARCHAR(50) NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; + +/******************** Add Table: favorite_question ************************/ + +/* Build Table Structure */ +CREATE TABLE favorite_question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + user_id INTEGER NOT NULL, + added_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8; + +/* Table Items: favorite_question */ + +/* Add Indexes for: favorite_question */ +CREATE INDEX favorite_question_question_id ON favorite_question (question_id); +CREATE INDEX favorite_question_user_id ON favorite_question (user_id); + +/******************** Add Table: flagged_item ************************/ + +/* Build Table Structure */ +CREATE TABLE flagged_item +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + flagged_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8; + +/* Table Items: flagged_item */ + +/* Add Indexes for: flagged_item */ +CREATE UNIQUE INDEX content_type_id ON flagged_item (content_type_id, object_id, user_id); +CREATE INDEX flagged_item_content_type_id ON flagged_item (content_type_id); +CREATE INDEX flagged_item_user_id ON flagged_item (user_id); + +/******************** Add Table: question ************************/ + +/* Build Table Structure */ +CREATE TABLE question +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + title TEXT NOT NULL, + author_id INTEGER NOT NULL, + added_at DATETIME NOT NULL, + wiki TINYINT NOT NULL, + wikified_at DATETIME NULL, + answer_accepted TINYINT NOT NULL, + closed TINYINT NOT NULL, + closed_by_id INTEGER NULL, + closed_at DATETIME NULL, + close_reason SMALLINT NULL, + deleted TINYINT NOT NULL, + deleted_at DATETIME NULL, + deleted_by_id INTEGER NULL, + locked TINYINT NOT NULL, + locked_by_id INTEGER NULL, + locked_at DATETIME NULL, + score INTEGER NOT NULL, + answer_count INTEGER UNSIGNED NOT NULL, + comment_count INTEGER UNSIGNED NOT NULL, + view_count INTEGER UNSIGNED NOT NULL, + offensive_flag_count SMALLINT NOT NULL, + favourite_count INTEGER UNSIGNED NOT NULL, + last_edited_at DATETIME NULL, + last_edited_by_id INTEGER NULL, + last_activity_at DATETIME NOT NULL, + last_activity_by_id INTEGER NOT NULL, + tagnames VARCHAR(125) NOT NULL, + summary VARCHAR(180) NOT NULL, + html LONGTEXT NOT NULL, + vote_up_count INTEGER NOT NULL, + vote_down_count INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8; + +/* Table Items: question */ + +/* Add Indexes for: question */ +CREATE INDEX question_author_id ON question (author_id); +CREATE INDEX question_closed_by_id ON question (closed_by_id); +CREATE INDEX question_deleted_by_id ON question (deleted_by_id); +CREATE INDEX question_last_activity_by_id ON question (last_activity_by_id); +CREATE INDEX question_last_edited_by_id ON question (last_edited_by_id); +CREATE INDEX question_locked_by_id ON question (locked_by_id); + +/******************** Add Table: question_revision ************************/ + +/* Build Table Structure */ +CREATE TABLE question_revision +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + revision INTEGER UNSIGNED NOT NULL, + title TEXT NOT NULL, + author_id INTEGER NOT NULL, + revised_at DATETIME NOT NULL, + tagnames VARCHAR(125) NOT NULL, + summary TEXT NOT NULL, + `text` LONGTEXT NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=3 DEFAULT CHARSET=latin1; + +/* Table Items: question_revision */ + +/* Add Indexes for: question_revision */ +CREATE INDEX question_revision_author_id ON question_revision (author_id); +CREATE INDEX question_revision_question_id ON question_revision (question_id); + +/******************** Add Table: question_tags ************************/ + +/* Build Table Structure */ +CREATE TABLE question_tags +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + question_id INTEGER NOT NULL, + tag_id INTEGER NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8; + +/* Table Items: question_tags */ + +/* Add Indexes for: question_tags */ +CREATE UNIQUE INDEX question_id ON question_tags (question_id, tag_id); +CREATE INDEX tag_id_refs_id_43fcb953 ON question_tags (tag_id); + +/******************** Add Table: repute ************************/ + +/* Build Table Structure */ +CREATE TABLE repute +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + positive SMALLINT NOT NULL, + negative SMALLINT NOT NULL, + question_id INTEGER NOT NULL, + reputed_at DATETIME NOT NULL, + reputation_type SMALLINT NOT NULL, + reputation INTEGER NOT NULL +) ENGINE=MyISAM AUTO_INCREMENT=17 DEFAULT CHARSET=latin1; + +/* Table Items: repute */ + +/* Add Indexes for: repute */ +CREATE INDEX repute_question_id ON repute (question_id); +CREATE INDEX repute_user_id ON repute (user_id); + +/******************** Add Table: tag ************************/ + +/* Build Table Structure */ +CREATE TABLE tag +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + name VARCHAR(255) NOT NULL, + created_by_id INTEGER NOT NULL, + used_count INTEGER UNSIGNED NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8; + +/* Table Items: tag */ + +/* Add Indexes for: tag */ +CREATE UNIQUE INDEX name ON tag (name); +CREATE INDEX tag_created_by_id ON tag (created_by_id); + +/******************** Add Table: user_badge ************************/ + +/* Build Table Structure */ +CREATE TABLE user_badge +( + id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + badge_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: user_badge */ + +/* Add Indexes for: user_badge */ +CREATE INDEX fk_user_badge_auth_user ON user_badge (user_id); +CREATE INDEX fk_user_badge_badge ON user_badge (badge_id); + +/******************** Add Table: user_favorite_questions ************************/ + +/* Build Table Structure */ +CREATE TABLE user_favorite_questions +( + id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + user_id INTEGER NOT NULL, + question_id INTEGER NOT NULL +) ENGINE=InnoDB DEFAULT CHARSET=utf8; + +/* Table Items: user_favorite_questions */ + +/* Add Indexes for: user_favorite_questions */ +CREATE INDEX fk_user_favorite_questions_auth_user ON user_favorite_questions (user_id); +CREATE INDEX fk_user_favorite_questions_question ON user_favorite_questions (question_id); + +/******************** Add Table: vote ************************/ + +/* Build Table Structure */ +CREATE TABLE vote +( + id INTEGER NOT NULL AUTO_INCREMENT PRIMARY KEY, + content_type_id INTEGER NOT NULL, + object_id INTEGER UNSIGNED NOT NULL, + user_id INTEGER NOT NULL, + vote SMALLINT NOT NULL, + voted_at DATETIME NOT NULL +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8; + +/* Table Items: vote */ + +/* Add Indexes for: vote */ +CREATE UNIQUE INDEX content_type_id ON vote (content_type_id, object_id, user_id); +CREATE INDEX vote_content_type_id ON vote (content_type_id); +CREATE INDEX vote_user_id ON vote (user_id); + + +/************ Add Foreign Keys to Database ***************/ +/*----------------------------------------------------------- +Warning: Versions of MySQL prior to 4.1.2 require indexes on all columns involved in a foreign key. The following indexes may be required: +fk_auth_group_permissions_auth_group may require an index on table: auth_group_permissions, column: group_id +fk_auth_user_groups_auth_user may require an index on table: auth_user_groups, column: user_id +fk_auth_user_user_permissions_auth_user may require an index on table: auth_user_user_permissions, column: user_id +fk_question_tags_question may require an index on table: question_tags, column: question_id +----------------------------------------------------------- +*/ + +/************ 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: deleted_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT deleted_by_id_refs_id_192b0170 + FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_auth_user ***************/ +ALTER TABLE answer ADD CONSTRAINT fk_answer_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_question ***************/ +ALTER TABLE answer ADD CONSTRAINT fk_answer_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_edited_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT last_edited_by_id_refs_id_192b0170 + FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: locked_by_id_refs_id_192b0170 ***************/ +ALTER TABLE answer ADD CONSTRAINT locked_by_id_refs_id_192b0170 + FOREIGN KEY (locked_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_answer_revision_auth_user ***************/ +ALTER TABLE answer_revision ADD CONSTRAINT fk_answer_revision_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_group_permissions_auth_group ***************/ +ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_group + FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_group_permissions_auth_permission ***************/ +ALTER TABLE auth_group_permissions ADD CONSTRAINT fk_auth_group_permissions_auth_permission + FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_message_auth_user ***************/ +ALTER TABLE auth_message ADD CONSTRAINT fk_auth_message_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_permission_django_content_type ***************/ +ALTER TABLE auth_permission ADD CONSTRAINT fk_auth_permission_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_groups_auth_group ***************/ +ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_group + FOREIGN KEY (group_id) REFERENCES auth_group (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_groups_auth_user ***************/ +ALTER TABLE auth_user_groups ADD CONSTRAINT fk_auth_user_groups_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_user_permissions_auth_permission ***************/ +ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_permission + FOREIGN KEY (permission_id) REFERENCES auth_permission (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_auth_user_user_permissions_auth_user ***************/ +ALTER TABLE auth_user_user_permissions ADD CONSTRAINT fk_auth_user_user_permissions_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_award_auth_user ***************/ +ALTER TABLE award ADD CONSTRAINT fk_award_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_award_badge ***************/ +ALTER TABLE award ADD CONSTRAINT fk_award_badge + FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_books_auth_user ***************/ +ALTER TABLE book ADD CONSTRAINT fk_books_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_info_auth_user ***************/ +ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_info_book ***************/ +ALTER TABLE book_author_info ADD CONSTRAINT fk_book_author_info_book + FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_rss_auth_user ***************/ +ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_author_rss_book ***************/ +ALTER TABLE book_author_rss ADD CONSTRAINT fk_book_author_rss_book + FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_question_book ***************/ +ALTER TABLE book_question ADD CONSTRAINT fk_book_question_book + FOREIGN KEY (book_id) REFERENCES book (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_book_question_question ***************/ +ALTER TABLE book_question ADD CONSTRAINT fk_book_question_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_comment_auth_user ***************/ +ALTER TABLE `comment` ADD CONSTRAINT fk_comment_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_comment_django_content_type ***************/ +ALTER TABLE `comment` ADD CONSTRAINT fk_comment_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_admin_log_auth_user ***************/ +ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_admin_log_django_content_type ***************/ +ALTER TABLE django_admin_log ADD CONSTRAINT fk_django_admin_log_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_authopenid_userassociation_auth_user ***************/ +ALTER TABLE django_authopenid_userassociation ADD CONSTRAINT fk_django_authopenid_userassociation_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_django_authopenid_userpasswordqueue_auth_user ***************/ +ALTER TABLE django_authopenid_userpasswordqueue ADD CONSTRAINT fk_django_authopenid_userpasswordqueue_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_favorite_question_auth_user ***************/ +ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_favorite_question_question ***************/ +ALTER TABLE favorite_question ADD CONSTRAINT fk_favorite_question_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_flagged_item_auth_user ***************/ +ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_flagged_item_django_content_type ***************/ +ALTER TABLE flagged_item ADD CONSTRAINT fk_flagged_item_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: closed_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT closed_by_id_refs_id_56e9d00c + FOREIGN KEY (closed_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: deleted_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT deleted_by_id_refs_id_56e9d00c + FOREIGN KEY (deleted_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_question_auth_user ***************/ +ALTER TABLE question ADD CONSTRAINT fk_question_auth_user + FOREIGN KEY (author_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_activity_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT last_activity_by_id_refs_id_56e9d00c + FOREIGN KEY (last_activity_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: last_edited_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT last_edited_by_id_refs_id_56e9d00c + FOREIGN KEY (last_edited_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: locked_by_id_refs_id_56e9d00c ***************/ +ALTER TABLE question ADD CONSTRAINT locked_by_id_refs_id_56e9d00c + FOREIGN KEY (locked_by_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_question_tags_question ***************/ +ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_question_tags_tag ***************/ +ALTER TABLE question_tags ADD CONSTRAINT fk_question_tags_tag + FOREIGN KEY (tag_id) REFERENCES tag (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; + +/************ Foreign Key: fk_tag_auth_user ***************/ +ALTER TABLE tag ADD CONSTRAINT fk_tag_auth_user + FOREIGN KEY (created_by_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_badge_auth_user ***************/ +ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_badge_badge ***************/ +ALTER TABLE user_badge ADD CONSTRAINT fk_user_badge_badge + FOREIGN KEY (badge_id) REFERENCES badge (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_favorite_questions_auth_user ***************/ +ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_user_favorite_questions_question ***************/ +ALTER TABLE user_favorite_questions ADD CONSTRAINT fk_user_favorite_questions_question + FOREIGN KEY (question_id) REFERENCES question (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_vote_auth_user ***************/ +ALTER TABLE vote ADD CONSTRAINT fk_vote_auth_user + FOREIGN KEY (user_id) REFERENCES auth_user (id) ON UPDATE NO ACTION ON DELETE NO ACTION; + +/************ Foreign Key: fk_vote_django_content_type ***************/ +ALTER TABLE vote ADD CONSTRAINT fk_vote_django_content_type + FOREIGN KEY (content_type_id) REFERENCES django_content_type (id) ON UPDATE NO ACTION ON DELETE NO ACTION;
\ No newline at end of file diff --git a/sql_scripts/update_2009_01_13_001.sql b/sql_scripts/update_2009_01_13_001.sql new file mode 100644 index 00000000..165d1125 --- /dev/null +++ b/sql_scripts/update_2009_01_13_001.sql @@ -0,0 +1,62 @@ +-- phpMyAdmin SQL Dump +-- version 3.0.0-beta +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Jan 12, 2009 at 08:55 PM +-- Server version: 5.0.67 +-- PHP Version: 5.2.6 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `twogeekt_lanai` +-- + +-- +-- Dumping data for table `badge` +-- + +INSERT INTO `badge` (`id`, `name`, `type`, `slug`, `description`, `multiple`, `awarded_count`) VALUES +(1, '炼狱法师', 3, '炼狱法师', '删除自己有3个以上赞成票的帖子', 1, 0), +(2, '压力白领', 3, '压力白领', '删除自己有3个以上反对票的帖子', 1, 0), +(3, '优秀回答', 3, '优秀回答', '回答好评10次以上', 1, 0), +(4, '优秀问题', 3, '优秀问题', '问题好评10次以上', 1, 0), +(5, '评论家', 3, '评论家', '评论10次以上', 1, 0), +(6, '流行问题', 3, '流行问题', '问题的浏览量超过1000人次', 1, 0), +(7, '巡逻兵', 3, '巡逻兵', '第一次标记垃圾帖子', 1, 0), +(8, '清洁工', 3, '清洁工', '第一次撤销投票', 1, 0), +(9, '批评家', 3, '批评家', '第一次反对票', 1, 0), +(10, '小编', 3, '小编', '第一次编辑更新', 1, 0), +(11, '村长', 3, '村长', '第一次重新标签', 1, 0), +(12, '学者', 3, '学者', '第一次标记答案', 1, 0), +(13, '学生', 3, '学生', '第一次提问并且有一次以上赞成票', 1, 0), +(14, '支持者', 3, '支持者', '第一次赞成票', 1, 0), +(15, '教师', 3, '教师', '第一次回答问题并且得到一个以上赞成票', 1, 0), +(16, '自传作者', 3, '自传作者', '完整填写用户资料所有选项', 1, 0), +(17, '自学成才', 3, '自学成才', '回答自己的问题并且有3个以上赞成票', 1, 0), +(18, '最有价值回答', 1, '最有价值回答', '回答超过100次赞成票', 1, 0), +(19, '最有价值问题', 1, '最有价值问题', '问题超过100次赞成票', 1, 0), +(20, '万人迷', 1, '万人迷', '问题被100人以上收藏', 1, 0), +(21, '著名问题', 1, '著名问题', '问题的浏览量超过10000人次', 1, 0), +(22, 'alpha用户', 2, 'alpha用户', '内测期间的活跃用户', 1, 0), +(23, '极好回答', 2, '极好回答', '回答超过25次赞成票', 1, 0), +(24, '极好问题', 2, '极好问题', '问题超过25次赞成票', 1, 0), +(25, '受欢迎问题', 2, '受欢迎问题', '问题被25人以上收藏', 1, 0), +(26, '优秀市民', 2, '优秀市民', '投票300次以上', 1, 0), +(27, '编辑主任', 2, '编辑主任', '编辑了100个帖子', 1, 0), +(28, '通才', 2, '通才', '在多个标签领域活跃', 1, 0), +(29, '专家', 2, '专家', '在一个标签领域活跃出众', 1, 0), +(30, '老鸟', 2, '老鸟', '活跃超过一年的用户', 1, 0), +(31, '最受关注问题', 2, '最受关注问题', '问题的浏览量超过2500人次', 1, 0), +(32, '学问家', 2, '学问家', '第一次回答被投赞成票10次以上', 1, 0), +(33, 'beta用户', 2, 'beta用户', 'beta期间活跃参与', 1, 0), +(34, '导师', 2, '导师', '被指定为最佳答案并且赞成票40以上', 1, 0), +(35, '巫师', 2, '巫师', '在提问60天之后回答并且赞成票5次以上', 1, 0), +(36, '分类专家', 2, '分类专家', '创建的标签被50个以上问题使用', 1, 0); diff --git a/sql_scripts/update_2009_01_13_002.sql b/sql_scripts/update_2009_01_13_002.sql new file mode 100644 index 00000000..c223cb8c --- /dev/null +++ b/sql_scripts/update_2009_01_13_002.sql @@ -0,0 +1 @@ +ALTER TABLE activity ADD COLUMN is_auditted tinyint(1) DEFAULT 0
\ No newline at end of file diff --git a/sql_scripts/update_2009_01_18_001.sql b/sql_scripts/update_2009_01_18_001.sql new file mode 100644 index 00000000..6f29fa32 --- /dev/null +++ b/sql_scripts/update_2009_01_18_001.sql @@ -0,0 +1,62 @@ +-- phpMyAdmin SQL Dump +-- version 3.0.0-beta +-- http://www.phpmyadmin.net +-- +-- Host: localhost +-- Generation Time: Jan 12, 2009 at 08:55 PM +-- Server version: 5.0.67 +-- PHP Version: 5.2.6 + +SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; + + +/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; +/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; +/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; +/*!40101 SET NAMES utf8 */; + +-- +-- Database: `twogeekt_lanai` +-- + +-- +-- Dumping data for table `badge` +-- + +INSERT INTO `badge` (`id`, `name`, `type`, `slug`, `description`, `multiple`, `awarded_count`) VALUES +(1, '炼狱法师', 3, '炼狱法师', '删除自己有3个以上赞成票的帖子', 1, 0), +(2, '压力白领', 3, '压力白领', '删除自己有3个以上反对票的帖子', 1, 0), +(3, '优秀回答', 3, '优秀回答', '回答好评10次以上', 1, 0), +(4, '优秀问题', 3, '优秀问题', '问题好评10次以上', 1, 0), +(5, '评论家', 3, '评论家', '评论10次以上', 0, 0), +(6, '流行问题', 3, '流行问题', '问题的浏览量超过1000人次', 1, 0), +(7, '巡逻兵', 3, '巡逻兵', '第一次标记垃圾帖子', 0, 0), +(8, '清洁工', 3, '清洁工', '第一次撤销投票', 0, 0), +(9, '批评家', 3, '批评家', '第一次反对票', 0, 0), +(10, '小编', 3, '小编', '第一次编辑更新', 0, 0), +(11, '村长', 3, '村长', '第一次重新标签', 0, 0), +(12, '学者', 3, '学者', '第一次标记答案', 0, 0), +(13, '学生', 3, '学生', '第一次提问并且有一次以上赞成票', 0, 0), +(14, '支持者', 3, '支持者', '第一次赞成票', 0, 0), +(15, '教师', 3, '教师', '第一次回答问题并且得到一个以上赞成票', 0, 0), +(16, '自传作者', 3, '自传作者', '完整填写用户资料所有选项', 0, 0), +(17, '自学成才', 3, '自学成才', '回答自己的问题并且有3个以上赞成票', 1, 0), +(18, '最有价值回答', 1, '最有价值回答', '回答超过100次赞成票', 1, 0), +(19, '最有价值问题', 1, '最有价值问题', '问题超过100次赞成票', 1, 0), +(20, '万人迷', 1, '万人迷', '问题被100人以上收藏', 1, 0), +(21, '著名问题', 1, '著名问题', '问题的浏览量超过10000人次', 1, 0), +(22, 'alpha用户', 2, 'alpha用户', '内测期间的活跃用户', 0, 0), +(23, '极好回答', 2, '极好回答', '回答超过25次赞成票', 1, 0), +(24, '极好问题', 2, '极好问题', '问题超过25次赞成票', 1, 0), +(25, '受欢迎问题', 2, '受欢迎问题', '问题被25人以上收藏', 1, 0), +(26, '优秀市民', 2, '优秀市民', '投票300次以上', 0, 0), +(27, '编辑主任', 2, '编辑主任', '编辑了100个帖子', 0, 0), +(28, '通才', 2, '通才', '在多个标签领域活跃', 0, 0), +(29, '专家', 2, '专家', '在一个标签领域活跃出众', 0, 0), +(30, '老鸟', 2, '老鸟', '活跃超过一年的用户', 0, 0), +(31, '最受关注问题', 2, '最受关注问题', '问题的浏览量超过2500人次', 1, 0), +(32, '学问家', 2, '学问家', '第一次回答被投赞成票10次以上', 0, 0), +(33, 'beta用户', 2, 'beta用户', 'beta期间活跃参与', 0, 0), +(34, '导师', 2, '导师', '被指定为最佳答案并且赞成票40以上', 1, 0), +(35, '巫师', 2, '巫师', '在提问60天之后回答并且赞成票5次以上', 1, 0), +(36, '分类专家', 2, '分类专家', '创建的标签被50个以上问题使用', 1, 0); diff --git a/sql_scripts/update_2009_01_24.sql b/sql_scripts/update_2009_01_24.sql new file mode 100644 index 00000000..45b83935 --- /dev/null +++ b/sql_scripts/update_2009_01_24.sql @@ -0,0 +1,2 @@ +ALTER TABLE award ADD COLUMN `content_type_id` int(11); +ALTER TABLE award ADD COLUMN `object_id` int(10);
\ No newline at end of file diff --git a/sql_scripts/update_2009_01_25_001.sql b/sql_scripts/update_2009_01_25_001.sql new file mode 100644 index 00000000..1f1942e3 --- /dev/null +++ b/sql_scripts/update_2009_01_25_001.sql @@ -0,0 +1,2 @@ +ALTER TABLE `award` ADD `content_type_id` INT NULL
+ALTER TABLE `award` ADD `object_id` INT NULL
\ No newline at end of file diff --git a/sql_scripts/update_2009_02_26_001.sql b/sql_scripts/update_2009_02_26_001.sql new file mode 100644 index 00000000..9cc80974 --- /dev/null +++ b/sql_scripts/update_2009_02_26_001.sql @@ -0,0 +1,19 @@ +ALTER TABLE answer ADD COLUMN `accepted_at` datetime default null;
+
+/* Update accepted_at column with answer added datetime for existing data */
+UPDATE answer
+SET accepted_at = added_at
+WHERE accepted = 1 AND accepted_at IS NULL;
+
+/* workround for c# url problem on bluehost server */
+UPDATE tag
+SET name = 'csharp'
+WHERE name = 'c#'
+
+UPDATE question
+SET tagnames = replace(tagnames, 'c#', 'csharp')
+WHERE tagnames like '%c#%'
+
+UPDATE question_revision
+SET tagnames = replace(tagnames, 'c#', 'csharp')
+WHERE tagnames like '%c#%'
\ No newline at end of file diff --git a/sql_scripts/update_2009_04_10_001.sql b/sql_scripts/update_2009_04_10_001.sql new file mode 100644 index 00000000..b0d05ac7 --- /dev/null +++ b/sql_scripts/update_2009_04_10_001.sql @@ -0,0 +1,3 @@ +ALTER TABLE Tag ADD COLUMN deleted_at datetime default null;
+ALTER TABLE Tag ADD COLUMN deleted_by_id INTEGER NULL;
+ALTER TABLE Tag ADD COLUMN deleted TINYINT NOT NULL;
\ No newline at end of file diff --git a/sql_scripts/update_2009_12_24_001.sql b/sql_scripts/update_2009_12_24_001.sql new file mode 100644 index 00000000..3d082c2f --- /dev/null +++ b/sql_scripts/update_2009_12_24_001.sql @@ -0,0 +1,5 @@ +alter table question add column `vote_up_count` int(11) NOT NULL; +alter table question add column `vote_down_count` int(11) NOT NULL; + +alter table answer add column `vote_up_count` int(11) NOT NULL; +alter table answer add column `vote_down_count` int(11) NOT NULL;
\ No newline at end of file diff --git a/sql_scripts/update_2009_12_27_001.sql b/sql_scripts/update_2009_12_27_001.sql new file mode 100644 index 00000000..e2da7d4d --- /dev/null +++ b/sql_scripts/update_2009_12_27_001.sql @@ -0,0 +1,3 @@ +ALTER TABLE comment DROP INDEX content_type_id; + +ALTER TABLE comment ADD INDEX `content_type_id` (`content_type_id`,`object_id`,`user_id`);
\ No newline at end of file diff --git a/sql_scripts/update_2009_12_27_002.sql b/sql_scripts/update_2009_12_27_002.sql new file mode 100644 index 00000000..a36470bf --- /dev/null +++ b/sql_scripts/update_2009_12_27_002.sql @@ -0,0 +1 @@ +ALTER TABLE `vote` ADD `voted_at` DATETIME NOT NULL
\ No newline at end of file |