ks_mysql.sql 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793
  1. /*
  2. Navicat MySQL Data Transfer
  3. Source Server : 本机
  4. Source Server Version : 50715
  5. Source Host : localhost:3306
  6. Source Database : ks
  7. Target Server Type : MYSQL
  8. Target Server Version : 50715
  9. File Encoding : 65001
  10. Date: 2021-11-22 11:04:30
  11. */
  12. SET FOREIGN_KEY_CHECKS=0;
  13. -- ----------------------------
  14. -- Table structure for `auth_group`
  15. -- ----------------------------
  16. DROP TABLE IF EXISTS `auth_group`;
  17. CREATE TABLE `auth_group` (
  18. `id` int(11) NOT NULL AUTO_INCREMENT,
  19. `name` varchar(150) NOT NULL,
  20. PRIMARY KEY (`id`),
  21. UNIQUE KEY `name` (`name`)
  22. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  23. -- ----------------------------
  24. -- Records of auth_group
  25. -- ----------------------------
  26. -- ----------------------------
  27. -- Table structure for `auth_group_permissions`
  28. -- ----------------------------
  29. DROP TABLE IF EXISTS `auth_group_permissions`;
  30. CREATE TABLE `auth_group_permissions` (
  31. `id` int(11) NOT NULL AUTO_INCREMENT,
  32. `group_id` int(11) NOT NULL,
  33. `permission_id` int(11) NOT NULL,
  34. PRIMARY KEY (`id`),
  35. UNIQUE KEY `auth_group_permissions_group_id_permission_id_0cd325b0_uniq` (`group_id`,`permission_id`),
  36. KEY `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` (`permission_id`),
  37. CONSTRAINT `auth_group_permissio_permission_id_84c5c92e_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  38. CONSTRAINT `auth_group_permissions_group_id_b120cbf9_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`)
  39. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  40. -- ----------------------------
  41. -- Records of auth_group_permissions
  42. -- ----------------------------
  43. -- ----------------------------
  44. -- Table structure for `auth_permission`
  45. -- ----------------------------
  46. DROP TABLE IF EXISTS `auth_permission`;
  47. CREATE TABLE `auth_permission` (
  48. `id` int(11) NOT NULL AUTO_INCREMENT,
  49. `name` varchar(255) NOT NULL,
  50. `content_type_id` int(11) NOT NULL,
  51. `codename` varchar(100) NOT NULL,
  52. PRIMARY KEY (`id`),
  53. UNIQUE KEY `auth_permission_content_type_id_codename_01ab375a_uniq` (`content_type_id`,`codename`),
  54. CONSTRAINT `auth_permission_content_type_id_2f476e4b_fk_django_co` FOREIGN KEY (`content_type_id`) REFERENCES `django_content_type` (`id`)
  55. ) ENGINE=InnoDB AUTO_INCREMENT=25 DEFAULT CHARSET=utf8;
  56. -- ----------------------------
  57. -- Records of auth_permission
  58. -- ----------------------------
  59. INSERT INTO `auth_permission` VALUES ('1', 'Can add permission', '1', 'add_permission');
  60. INSERT INTO `auth_permission` VALUES ('2', 'Can change permission', '1', 'change_permission');
  61. INSERT INTO `auth_permission` VALUES ('3', 'Can delete permission', '1', 'delete_permission');
  62. INSERT INTO `auth_permission` VALUES ('4', 'Can view permission', '1', 'view_permission');
  63. INSERT INTO `auth_permission` VALUES ('5', 'Can add group', '2', 'add_group');
  64. INSERT INTO `auth_permission` VALUES ('6', 'Can change group', '2', 'change_group');
  65. INSERT INTO `auth_permission` VALUES ('7', 'Can delete group', '2', 'delete_group');
  66. INSERT INTO `auth_permission` VALUES ('8', 'Can view group', '2', 'view_group');
  67. INSERT INTO `auth_permission` VALUES ('9', 'Can add content type', '3', 'add_contenttype');
  68. INSERT INTO `auth_permission` VALUES ('10', 'Can change content type', '3', 'change_contenttype');
  69. INSERT INTO `auth_permission` VALUES ('11', 'Can delete content type', '3', 'delete_contenttype');
  70. INSERT INTO `auth_permission` VALUES ('12', 'Can view content type', '3', 'view_contenttype');
  71. INSERT INTO `auth_permission` VALUES ('13', 'Can add session', '4', 'add_session');
  72. INSERT INTO `auth_permission` VALUES ('14', 'Can change session', '4', 'change_session');
  73. INSERT INTO `auth_permission` VALUES ('15', 'Can delete session', '4', 'delete_session');
  74. INSERT INTO `auth_permission` VALUES ('16', 'Can view session', '4', 'view_session');
  75. INSERT INTO `auth_permission` VALUES ('17', '浏览', '8', 'view_department');
  76. INSERT INTO `auth_permission` VALUES ('18', '添加', '8', 'add_department');
  77. INSERT INTO `auth_permission` VALUES ('19', '修改', '8', 'edit_department');
  78. INSERT INTO `auth_permission` VALUES ('20', '删除', '8', 'delete_department');
  79. INSERT INTO `auth_permission` VALUES ('21', '浏览', '9', 'view_user');
  80. INSERT INTO `auth_permission` VALUES ('22', '添加', '9', 'add_user');
  81. INSERT INTO `auth_permission` VALUES ('23', '修改', '9', 'edit_user');
  82. INSERT INTO `auth_permission` VALUES ('24', '删除', '9', 'delete_user');
  83. -- ----------------------------
  84. -- Table structure for `base_chapter`
  85. -- ----------------------------
  86. DROP TABLE IF EXISTS `base_chapter`;
  87. CREATE TABLE `base_chapter` (
  88. `id` int(11) NOT NULL AUTO_INCREMENT,
  89. `name` varchar(100) NOT NULL,
  90. `notes` varchar(500) DEFAULT NULL,
  91. `delete` tinyint(1) NOT NULL,
  92. `subject_id` int(11) NOT NULL,
  93. PRIMARY KEY (`id`),
  94. KEY `base_chapter_subject_id_0e4d03c0_fk_base_subject_id` (`subject_id`),
  95. CONSTRAINT `base_chapter_subject_id_0e4d03c0_fk_base_subject_id` FOREIGN KEY (`subject_id`) REFERENCES `base_subject` (`id`)
  96. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  97. -- ----------------------------
  98. -- Records of base_chapter
  99. -- ----------------------------
  100. -- ----------------------------
  101. -- Table structure for `base_subject`
  102. -- ----------------------------
  103. DROP TABLE IF EXISTS `base_subject`;
  104. CREATE TABLE `base_subject` (
  105. `id` int(11) NOT NULL AUTO_INCREMENT,
  106. `name` varchar(100) NOT NULL,
  107. `notes` varchar(500) DEFAULT NULL,
  108. `delete` tinyint(1) NOT NULL,
  109. PRIMARY KEY (`id`)
  110. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  111. -- ----------------------------
  112. -- Records of base_subject
  113. -- ----------------------------
  114. -- ----------------------------
  115. -- Table structure for `django_content_type`
  116. -- ----------------------------
  117. DROP TABLE IF EXISTS `django_content_type`;
  118. CREATE TABLE `django_content_type` (
  119. `id` int(11) NOT NULL AUTO_INCREMENT,
  120. `app_label` varchar(100) NOT NULL,
  121. `model` varchar(100) NOT NULL,
  122. PRIMARY KEY (`id`),
  123. UNIQUE KEY `django_content_type_app_label_model_76bd3d3b_uniq` (`app_label`,`model`)
  124. ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
  125. -- ----------------------------
  126. -- Records of django_content_type
  127. -- ----------------------------
  128. INSERT INTO `django_content_type` VALUES ('2', 'auth', 'group');
  129. INSERT INTO `django_content_type` VALUES ('1', 'auth', 'permission');
  130. INSERT INTO `django_content_type` VALUES ('3', 'contenttypes', 'contenttype');
  131. INSERT INTO `django_content_type` VALUES ('23', 'errorbook', 'errorbook');
  132. INSERT INTO `django_content_type` VALUES ('12', 'exam', 'exam');
  133. INSERT INTO `django_content_type` VALUES ('13', 'exam', 'examanswerfilllog');
  134. INSERT INTO `django_content_type` VALUES ('14', 'exam', 'examanswerlog');
  135. INSERT INTO `django_content_type` VALUES ('15', 'exam', 'examansweroptionlog');
  136. INSERT INTO `django_content_type` VALUES ('16', 'exam', 'examlog');
  137. INSERT INTO `django_content_type` VALUES ('17', 'exampaper', 'exampaper');
  138. INSERT INTO `django_content_type` VALUES ('18', 'exampaper', 'exampaperdetail');
  139. INSERT INTO `django_content_type` VALUES ('19', 'examquestion', 'examquestion');
  140. INSERT INTO `django_content_type` VALUES ('20', 'examquestion', 'examquestionfeedback');
  141. INSERT INTO `django_content_type` VALUES ('22', 'examquestion', 'examquestionfill');
  142. INSERT INTO `django_content_type` VALUES ('21', 'examquestion', 'examquestionoption');
  143. INSERT INTO `django_content_type` VALUES ('7', 'foundation', 'chapter');
  144. INSERT INTO `django_content_type` VALUES ('6', 'foundation', 'subject');
  145. INSERT INTO `django_content_type` VALUES ('10', 'knowledge', 'knowledgebase');
  146. INSERT INTO `django_content_type` VALUES ('11', 'knowledge', 'knowledgebasefeedback');
  147. INSERT INTO `django_content_type` VALUES ('24', 'practiselog', 'practiseanswerfilllog');
  148. INSERT INTO `django_content_type` VALUES ('25', 'practiselog', 'practiseanswerlog');
  149. INSERT INTO `django_content_type` VALUES ('26', 'practiselog', 'practiseansweroptionlog');
  150. INSERT INTO `django_content_type` VALUES ('27', 'practiselog', 'practiselog');
  151. INSERT INTO `django_content_type` VALUES ('4', 'sessions', 'session');
  152. INSERT INTO `django_content_type` VALUES ('8', 'staff', 'department');
  153. INSERT INTO `django_content_type` VALUES ('9', 'staff', 'user');
  154. INSERT INTO `django_content_type` VALUES ('5', 'system', 'syslog');
  155. -- ----------------------------
  156. -- Table structure for `django_migrations`
  157. -- ----------------------------
  158. DROP TABLE IF EXISTS `django_migrations`;
  159. CREATE TABLE `django_migrations` (
  160. `id` int(11) NOT NULL AUTO_INCREMENT,
  161. `app` varchar(255) NOT NULL,
  162. `name` varchar(255) NOT NULL,
  163. `applied` datetime(6) NOT NULL,
  164. PRIMARY KEY (`id`)
  165. ) ENGINE=InnoDB AUTO_INCREMENT=32 DEFAULT CHARSET=utf8;
  166. -- ----------------------------
  167. -- Records of django_migrations
  168. -- ----------------------------
  169. INSERT INTO `django_migrations` VALUES ('1', 'contenttypes', '0001_initial', '2021-11-22 11:02:49.353778');
  170. INSERT INTO `django_migrations` VALUES ('2', 'contenttypes', '0002_remove_content_type_name', '2021-11-22 11:02:49.447159');
  171. INSERT INTO `django_migrations` VALUES ('3', 'auth', '0001_initial', '2021-11-22 11:02:49.552288');
  172. INSERT INTO `django_migrations` VALUES ('4', 'auth', '0002_alter_permission_name_max_length', '2021-11-22 11:02:49.804353');
  173. INSERT INTO `django_migrations` VALUES ('5', 'auth', '0003_alter_user_email_max_length', '2021-11-22 11:02:49.812353');
  174. INSERT INTO `django_migrations` VALUES ('6', 'auth', '0004_alter_user_username_opts', '2021-11-22 11:02:49.821354');
  175. INSERT INTO `django_migrations` VALUES ('7', 'auth', '0005_alter_user_last_login_null', '2021-11-22 11:02:49.828353');
  176. INSERT INTO `django_migrations` VALUES ('8', 'auth', '0006_require_contenttypes_0002', '2021-11-22 11:02:49.831355');
  177. INSERT INTO `django_migrations` VALUES ('9', 'auth', '0007_alter_validators_add_error_messages', '2021-11-22 11:02:49.838354');
  178. INSERT INTO `django_migrations` VALUES ('10', 'auth', '0008_alter_user_username_max_length', '2021-11-22 11:02:49.845354');
  179. INSERT INTO `django_migrations` VALUES ('11', 'auth', '0009_alter_user_last_name_max_length', '2021-11-22 11:02:49.853354');
  180. INSERT INTO `django_migrations` VALUES ('12', 'auth', '0010_alter_group_name_max_length', '2021-11-22 11:02:49.910354');
  181. INSERT INTO `django_migrations` VALUES ('13', 'auth', '0011_update_proxy_permissions', '2021-11-22 11:02:49.919353');
  182. INSERT INTO `django_migrations` VALUES ('14', 'staff', '0001_initial', '2021-11-22 11:02:50.086353');
  183. INSERT INTO `django_migrations` VALUES ('15', 'examquestion', '0001_initial', '2021-11-22 11:02:50.550353');
  184. INSERT INTO `django_migrations` VALUES ('16', 'exampaper', '0001_initial', '2021-11-22 11:02:50.750352');
  185. INSERT INTO `django_migrations` VALUES ('17', 'exam', '0001_initial', '2021-11-22 11:02:50.959352');
  186. INSERT INTO `django_migrations` VALUES ('18', 'exam', '0002_examlog_exampaper', '2021-11-22 11:02:51.133905');
  187. INSERT INTO `django_migrations` VALUES ('19', 'errorbook', '0001_initial', '2021-11-22 11:02:51.218662');
  188. INSERT INTO `django_migrations` VALUES ('20', 'errorbook', '0002_auto_20211122_1037', '2021-11-22 11:02:51.359028');
  189. INSERT INTO `django_migrations` VALUES ('21', 'foundation', '0001_initial', '2021-11-22 11:02:51.573027');
  190. INSERT INTO `django_migrations` VALUES ('22', 'exampaper', '0002_exampaperdetail_question', '2021-11-22 11:02:51.679028');
  191. INSERT INTO `django_migrations` VALUES ('23', 'exam', '0003_auto_20211122_1037', '2021-11-22 11:02:52.282053');
  192. INSERT INTO `django_migrations` VALUES ('24', 'exampaper', '0003_auto_20211122_1037', '2021-11-22 11:02:52.869101');
  193. INSERT INTO `django_migrations` VALUES ('25', 'examquestion', '0002_auto_20211122_1037', '2021-11-22 11:02:53.328330');
  194. INSERT INTO `django_migrations` VALUES ('26', 'knowledge', '0001_initial', '2021-11-22 11:02:53.658249');
  195. INSERT INTO `django_migrations` VALUES ('27', 'knowledge', '0002_auto_20211122_1037', '2021-11-22 11:02:53.967124');
  196. INSERT INTO `django_migrations` VALUES ('28', 'practiselog', '0001_initial', '2021-11-22 11:02:54.428180');
  197. INSERT INTO `django_migrations` VALUES ('29', 'practiselog', '0002_auto_20211122_1037', '2021-11-22 11:02:55.001445');
  198. INSERT INTO `django_migrations` VALUES ('30', 'sessions', '0001_initial', '2021-11-22 11:02:55.518403');
  199. INSERT INTO `django_migrations` VALUES ('31', 'system', '0001_initial', '2021-11-22 11:02:55.595400');
  200. -- ----------------------------
  201. -- Table structure for `django_session`
  202. -- ----------------------------
  203. DROP TABLE IF EXISTS `django_session`;
  204. CREATE TABLE `django_session` (
  205. `session_key` varchar(40) NOT NULL,
  206. `session_data` longtext NOT NULL,
  207. `expire_date` datetime(6) NOT NULL,
  208. PRIMARY KEY (`session_key`),
  209. KEY `django_session_expire_date_a5c62663` (`expire_date`)
  210. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  211. -- ----------------------------
  212. -- Records of django_session
  213. -- ----------------------------
  214. -- ----------------------------
  215. -- Table structure for `exam`
  216. -- ----------------------------
  217. DROP TABLE IF EXISTS `exam`;
  218. CREATE TABLE `exam` (
  219. `id` int(11) NOT NULL AUTO_INCREMENT,
  220. `name` varchar(200) NOT NULL,
  221. `type` smallint(5) unsigned DEFAULT NULL,
  222. `duration` int(11) NOT NULL,
  223. `exam_time` datetime(6) NOT NULL,
  224. `exam_end_time` datetime(6) DEFAULT NULL,
  225. `desc` longtext,
  226. `examinee_count` int(11) NOT NULL,
  227. `create_time` datetime(6) NOT NULL,
  228. `delete` tinyint(1) NOT NULL,
  229. `create_user_id` int(11) NOT NULL,
  230. `exampaper_id` int(11) DEFAULT NULL,
  231. `subject_id` int(11) DEFAULT NULL,
  232. PRIMARY KEY (`id`),
  233. KEY `exam_create_user_id_5ba8a4b9_fk_staff_user_id` (`create_user_id`),
  234. KEY `exam_exampaper_id_3b69f262_fk_exam_paper_id` (`exampaper_id`),
  235. KEY `exam_subject_id_3be84281_fk_base_subject_id` (`subject_id`),
  236. CONSTRAINT `exam_create_user_id_5ba8a4b9_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  237. CONSTRAINT `exam_exampaper_id_3b69f262_fk_exam_paper_id` FOREIGN KEY (`exampaper_id`) REFERENCES `exam_paper` (`id`),
  238. CONSTRAINT `exam_subject_id_3be84281_fk_base_subject_id` FOREIGN KEY (`subject_id`) REFERENCES `base_subject` (`id`)
  239. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  240. -- ----------------------------
  241. -- Records of exam
  242. -- ----------------------------
  243. -- ----------------------------
  244. -- Table structure for `exam_answer_fill_log`
  245. -- ----------------------------
  246. DROP TABLE IF EXISTS `exam_answer_fill_log`;
  247. CREATE TABLE `exam_answer_fill_log` (
  248. `id` int(11) NOT NULL AUTO_INCREMENT,
  249. `content` longtext NOT NULL,
  250. `order` int(11) NOT NULL,
  251. `main_id` int(11) NOT NULL,
  252. PRIMARY KEY (`id`),
  253. KEY `exam_answer_fill_log_main_id_9b91f404_fk_exam_answer_log_id` (`main_id`),
  254. CONSTRAINT `exam_answer_fill_log_main_id_9b91f404_fk_exam_answer_log_id` FOREIGN KEY (`main_id`) REFERENCES `exam_answer_log` (`id`)
  255. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  256. -- ----------------------------
  257. -- Records of exam_answer_fill_log
  258. -- ----------------------------
  259. -- ----------------------------
  260. -- Table structure for `exam_answer_log`
  261. -- ----------------------------
  262. DROP TABLE IF EXISTS `exam_answer_log`;
  263. CREATE TABLE `exam_answer_log` (
  264. `id` int(11) NOT NULL AUTO_INCREMENT,
  265. `status` smallint(5) unsigned NOT NULL,
  266. `detail_id` int(11) NOT NULL,
  267. `main_id` int(11) NOT NULL,
  268. PRIMARY KEY (`id`),
  269. KEY `exam_answer_log_detail_id_63d3c2ee_fk_exam_paper_detail_id` (`detail_id`),
  270. KEY `exam_answer_log_main_id_41972038_fk_exam_log_id` (`main_id`),
  271. CONSTRAINT `exam_answer_log_detail_id_63d3c2ee_fk_exam_paper_detail_id` FOREIGN KEY (`detail_id`) REFERENCES `exam_paper_detail` (`id`),
  272. CONSTRAINT `exam_answer_log_main_id_41972038_fk_exam_log_id` FOREIGN KEY (`main_id`) REFERENCES `exam_log` (`id`)
  273. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  274. -- ----------------------------
  275. -- Records of exam_answer_log
  276. -- ----------------------------
  277. -- ----------------------------
  278. -- Table structure for `exam_answer_option_log`
  279. -- ----------------------------
  280. DROP TABLE IF EXISTS `exam_answer_option_log`;
  281. CREATE TABLE `exam_answer_option_log` (
  282. `id` int(11) NOT NULL AUTO_INCREMENT,
  283. `main_id` int(11) NOT NULL,
  284. `option_id` int(11) NOT NULL,
  285. PRIMARY KEY (`id`),
  286. KEY `exam_answer_option_log_main_id_e04537f3_fk_exam_answer_log_id` (`main_id`),
  287. KEY `exam_answer_option_l_option_id_3d0b0602_fk_exam_ques` (`option_id`),
  288. CONSTRAINT `exam_answer_option_l_option_id_3d0b0602_fk_exam_ques` FOREIGN KEY (`option_id`) REFERENCES `exam_question_option` (`id`),
  289. CONSTRAINT `exam_answer_option_log_main_id_e04537f3_fk_exam_answer_log_id` FOREIGN KEY (`main_id`) REFERENCES `exam_answer_log` (`id`)
  290. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  291. -- ----------------------------
  292. -- Records of exam_answer_option_log
  293. -- ----------------------------
  294. -- ----------------------------
  295. -- Table structure for `exam_log`
  296. -- ----------------------------
  297. DROP TABLE IF EXISTS `exam_log`;
  298. CREATE TABLE `exam_log` (
  299. `id` int(11) NOT NULL AUTO_INCREMENT,
  300. `type` smallint(5) unsigned NOT NULL,
  301. `scores` int(11) DEFAULT NULL,
  302. `rank` int(11) DEFAULT NULL,
  303. `use_time` int(11) DEFAULT NULL,
  304. `exam_time` datetime(6) DEFAULT NULL,
  305. `submit_time` datetime(6) DEFAULT NULL,
  306. `single_answer_scores` int(11) NOT NULL,
  307. `multiple_answer_scores` int(11) NOT NULL,
  308. `fill_answer_scores` int(11) NOT NULL,
  309. `judgment_answer_scores` int(11) NOT NULL,
  310. `single_answer_count` int(11) NOT NULL,
  311. `multiple_answer_count` int(11) NOT NULL,
  312. `fill_answer_count` int(11) NOT NULL,
  313. `judgment_answer_count` int(11) NOT NULL,
  314. `delete` tinyint(1) NOT NULL,
  315. `exam_id` int(11) DEFAULT NULL,
  316. `exampaper_id` int(11) DEFAULT NULL,
  317. `user_id` int(11) NOT NULL,
  318. PRIMARY KEY (`id`),
  319. KEY `exam_log_exam_id_0e9f5769_fk_exam_id` (`exam_id`),
  320. KEY `exam_log_exampaper_id_1020fb7e_fk_exam_paper_id` (`exampaper_id`),
  321. KEY `exam_log_user_id_2208d647_fk_staff_user_id` (`user_id`),
  322. CONSTRAINT `exam_log_exam_id_0e9f5769_fk_exam_id` FOREIGN KEY (`exam_id`) REFERENCES `exam` (`id`),
  323. CONSTRAINT `exam_log_exampaper_id_1020fb7e_fk_exam_paper_id` FOREIGN KEY (`exampaper_id`) REFERENCES `exam_paper` (`id`),
  324. CONSTRAINT `exam_log_user_id_2208d647_fk_staff_user_id` FOREIGN KEY (`user_id`) REFERENCES `staff_user` (`id`)
  325. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  326. -- ----------------------------
  327. -- Records of exam_log
  328. -- ----------------------------
  329. -- ----------------------------
  330. -- Table structure for `exam_paper`
  331. -- ----------------------------
  332. DROP TABLE IF EXISTS `exam_paper`;
  333. CREATE TABLE `exam_paper` (
  334. `id` int(11) NOT NULL AUTO_INCREMENT,
  335. `name` varchar(200) NOT NULL,
  336. `type` smallint(5) unsigned NOT NULL,
  337. `passline` int(11) NOT NULL,
  338. `desc` longtext,
  339. `single_simple_count` int(11) NOT NULL,
  340. `multiple_simple_count` int(11) NOT NULL,
  341. `fill_simple_count` int(11) NOT NULL,
  342. `judgment_simple_count` int(11) NOT NULL,
  343. `single_mid_count` int(11) NOT NULL,
  344. `multiple_mid_count` int(11) NOT NULL,
  345. `fill_mid_count` int(11) NOT NULL,
  346. `judgment_mid_count` int(11) NOT NULL,
  347. `single_hard_count` int(11) NOT NULL,
  348. `multiple_hard_count` int(11) NOT NULL,
  349. `fill_hard_count` int(11) NOT NULL,
  350. `judgment_hard_count` int(11) NOT NULL,
  351. `single_scores` int(11) NOT NULL,
  352. `multiple_scores` int(11) NOT NULL,
  353. `fill_scores` int(11) NOT NULL,
  354. `judgment_scores` int(11) NOT NULL,
  355. `single_total_count` int(11) NOT NULL,
  356. `multiple_total_count` int(11) NOT NULL,
  357. `fill_total_count` int(11) NOT NULL,
  358. `judgment_total_count` int(11) NOT NULL,
  359. `single_total_scores` int(11) NOT NULL,
  360. `multiple_total_scores` int(11) NOT NULL,
  361. `fill_total_scores` int(11) NOT NULL,
  362. `judgment_total_scores` int(11) NOT NULL,
  363. `question_total_count` int(11) NOT NULL,
  364. `question_total_scores` int(11) NOT NULL,
  365. `create_time` datetime(6) NOT NULL,
  366. `is_delete` tinyint(1) NOT NULL,
  367. `did_count` int(11) NOT NULL,
  368. `create_user_id` int(11) NOT NULL,
  369. `subject_id` int(11) NOT NULL,
  370. PRIMARY KEY (`id`),
  371. KEY `exam_paper_create_user_id_533cebef_fk_staff_user_id` (`create_user_id`),
  372. KEY `exam_paper_subject_id_81063cdf_fk_base_subject_id` (`subject_id`),
  373. CONSTRAINT `exam_paper_create_user_id_533cebef_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  374. CONSTRAINT `exam_paper_subject_id_81063cdf_fk_base_subject_id` FOREIGN KEY (`subject_id`) REFERENCES `base_subject` (`id`)
  375. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  376. -- ----------------------------
  377. -- Records of exam_paper
  378. -- ----------------------------
  379. -- ----------------------------
  380. -- Table structure for `exam_paper_detail`
  381. -- ----------------------------
  382. DROP TABLE IF EXISTS `exam_paper_detail`;
  383. CREATE TABLE `exam_paper_detail` (
  384. `id` int(11) NOT NULL AUTO_INCREMENT,
  385. `order` int(11) NOT NULL,
  386. `delete` tinyint(1) NOT NULL,
  387. `main_id` int(11) NOT NULL,
  388. `question_id` int(11) NOT NULL,
  389. PRIMARY KEY (`id`),
  390. KEY `exam_paper_detail_main_id_35b8fb28_fk_exam_paper_id` (`main_id`),
  391. KEY `exam_paper_detail_question_id_889e45d0_fk_exam_question_id` (`question_id`),
  392. CONSTRAINT `exam_paper_detail_main_id_35b8fb28_fk_exam_paper_id` FOREIGN KEY (`main_id`) REFERENCES `exam_paper` (`id`),
  393. CONSTRAINT `exam_paper_detail_question_id_889e45d0_fk_exam_question_id` FOREIGN KEY (`question_id`) REFERENCES `exam_question` (`id`)
  394. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  395. -- ----------------------------
  396. -- Records of exam_paper_detail
  397. -- ----------------------------
  398. -- ----------------------------
  399. -- Table structure for `exam_question`
  400. -- ----------------------------
  401. DROP TABLE IF EXISTS `exam_question`;
  402. CREATE TABLE `exam_question` (
  403. `id` int(11) NOT NULL AUTO_INCREMENT,
  404. `type` smallint(5) unsigned NOT NULL,
  405. `difficulty` smallint(5) unsigned NOT NULL,
  406. `scores` int(11) NOT NULL,
  407. `title` longtext NOT NULL,
  408. `judgment` tinyint(1) NOT NULL,
  409. `analysis` longtext,
  410. `create_time` datetime(6) NOT NULL,
  411. `delete` tinyint(1) NOT NULL,
  412. `chapter_id` int(11) NOT NULL,
  413. `create_user_id` int(11) NOT NULL,
  414. PRIMARY KEY (`id`),
  415. KEY `exam_question_chapter_id_527b99a8_fk_base_chapter_id` (`chapter_id`),
  416. KEY `exam_question_create_user_id_1b9bb3dc_fk_staff_user_id` (`create_user_id`),
  417. CONSTRAINT `exam_question_chapter_id_527b99a8_fk_base_chapter_id` FOREIGN KEY (`chapter_id`) REFERENCES `base_chapter` (`id`),
  418. CONSTRAINT `exam_question_create_user_id_1b9bb3dc_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`)
  419. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  420. -- ----------------------------
  421. -- Records of exam_question
  422. -- ----------------------------
  423. -- ----------------------------
  424. -- Table structure for `exam_question_feedback`
  425. -- ----------------------------
  426. DROP TABLE IF EXISTS `exam_question_feedback`;
  427. CREATE TABLE `exam_question_feedback` (
  428. `id` int(11) NOT NULL AUTO_INCREMENT,
  429. `type` smallint(5) unsigned NOT NULL,
  430. `desc` longtext,
  431. `create_time` datetime(6) NOT NULL,
  432. `status` smallint(5) unsigned NOT NULL,
  433. `process_time` datetime(6) DEFAULT NULL,
  434. `create_user_id` int(11) NOT NULL,
  435. `main_id` int(11) NOT NULL,
  436. `process_user_id` int(11) DEFAULT NULL,
  437. PRIMARY KEY (`id`),
  438. KEY `exam_question_feedback_create_user_id_474b9632_fk_staff_user_id` (`create_user_id`),
  439. KEY `exam_question_feedback_main_id_0a5e8850_fk_exam_question_id` (`main_id`),
  440. KEY `exam_question_feedback_process_user_id_f8482974_fk_staff_user_id` (`process_user_id`),
  441. CONSTRAINT `exam_question_feedback_create_user_id_474b9632_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  442. CONSTRAINT `exam_question_feedback_main_id_0a5e8850_fk_exam_question_id` FOREIGN KEY (`main_id`) REFERENCES `exam_question` (`id`),
  443. CONSTRAINT `exam_question_feedback_process_user_id_f8482974_fk_staff_user_id` FOREIGN KEY (`process_user_id`) REFERENCES `staff_user` (`id`)
  444. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  445. -- ----------------------------
  446. -- Records of exam_question_feedback
  447. -- ----------------------------
  448. -- ----------------------------
  449. -- Table structure for `exam_question_fill`
  450. -- ----------------------------
  451. DROP TABLE IF EXISTS `exam_question_fill`;
  452. CREATE TABLE `exam_question_fill` (
  453. `id` int(11) NOT NULL AUTO_INCREMENT,
  454. `content` longtext NOT NULL,
  455. `order` int(11) NOT NULL,
  456. `delete` tinyint(1) NOT NULL,
  457. `main_id` int(11) NOT NULL,
  458. PRIMARY KEY (`id`),
  459. KEY `exam_question_fill_main_id_057b5b10_fk_exam_question_id` (`main_id`),
  460. CONSTRAINT `exam_question_fill_main_id_057b5b10_fk_exam_question_id` FOREIGN KEY (`main_id`) REFERENCES `exam_question` (`id`)
  461. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  462. -- ----------------------------
  463. -- Records of exam_question_fill
  464. -- ----------------------------
  465. -- ----------------------------
  466. -- Table structure for `exam_question_option`
  467. -- ----------------------------
  468. DROP TABLE IF EXISTS `exam_question_option`;
  469. CREATE TABLE `exam_question_option` (
  470. `id` int(11) NOT NULL AUTO_INCREMENT,
  471. `content` longtext NOT NULL,
  472. `right` tinyint(1) NOT NULL,
  473. `delete` tinyint(1) NOT NULL,
  474. `main_id` int(11) NOT NULL,
  475. PRIMARY KEY (`id`),
  476. KEY `exam_question_option_main_id_f07847c8_fk_exam_question_id` (`main_id`),
  477. CONSTRAINT `exam_question_option_main_id_f07847c8_fk_exam_question_id` FOREIGN KEY (`main_id`) REFERENCES `exam_question` (`id`)
  478. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  479. -- ----------------------------
  480. -- Records of exam_question_option
  481. -- ----------------------------
  482. -- ----------------------------
  483. -- Table structure for `knowledge_base`
  484. -- ----------------------------
  485. DROP TABLE IF EXISTS `knowledge_base`;
  486. CREATE TABLE `knowledge_base` (
  487. `id` int(11) NOT NULL AUTO_INCREMENT,
  488. `name` varchar(200) NOT NULL,
  489. `feature` longtext NOT NULL,
  490. `desc` longtext,
  491. `create_time` datetime(6) NOT NULL,
  492. `delete` tinyint(1) NOT NULL,
  493. `chapter_id` int(11) NOT NULL,
  494. `create_user_id` int(11) NOT NULL,
  495. PRIMARY KEY (`id`),
  496. KEY `knowledge_base_chapter_id_5d383c8f_fk_base_chapter_id` (`chapter_id`),
  497. KEY `knowledge_base_create_user_id_dc18d11c_fk_staff_user_id` (`create_user_id`),
  498. CONSTRAINT `knowledge_base_chapter_id_5d383c8f_fk_base_chapter_id` FOREIGN KEY (`chapter_id`) REFERENCES `base_chapter` (`id`),
  499. CONSTRAINT `knowledge_base_create_user_id_dc18d11c_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`)
  500. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  501. -- ----------------------------
  502. -- Records of knowledge_base
  503. -- ----------------------------
  504. -- ----------------------------
  505. -- Table structure for `knowledge_base_feedback`
  506. -- ----------------------------
  507. DROP TABLE IF EXISTS `knowledge_base_feedback`;
  508. CREATE TABLE `knowledge_base_feedback` (
  509. `id` int(11) NOT NULL AUTO_INCREMENT,
  510. `type` smallint(5) unsigned NOT NULL,
  511. `desc` longtext,
  512. `create_time` datetime(6) NOT NULL,
  513. `status` smallint(5) unsigned NOT NULL,
  514. `process_time` datetime(6) DEFAULT NULL,
  515. `create_user_id` int(11) NOT NULL,
  516. `main_id` int(11) NOT NULL,
  517. `process_user_id` int(11) DEFAULT NULL,
  518. PRIMARY KEY (`id`),
  519. KEY `knowledge_base_feedback_create_user_id_a33d831a_fk_staff_user_id` (`create_user_id`),
  520. KEY `knowledge_base_feedback_main_id_3474e6ae_fk_knowledge_base_id` (`main_id`),
  521. KEY `knowledge_base_feedb_process_user_id_b803bc89_fk_staff_use` (`process_user_id`),
  522. CONSTRAINT `knowledge_base_feedb_process_user_id_b803bc89_fk_staff_use` FOREIGN KEY (`process_user_id`) REFERENCES `staff_user` (`id`),
  523. CONSTRAINT `knowledge_base_feedback_create_user_id_a33d831a_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  524. CONSTRAINT `knowledge_base_feedback_main_id_3474e6ae_fk_knowledge_base_id` FOREIGN KEY (`main_id`) REFERENCES `knowledge_base` (`id`)
  525. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  526. -- ----------------------------
  527. -- Records of knowledge_base_feedback
  528. -- ----------------------------
  529. -- ----------------------------
  530. -- Table structure for `practise_answer_fill_log`
  531. -- ----------------------------
  532. DROP TABLE IF EXISTS `practise_answer_fill_log`;
  533. CREATE TABLE `practise_answer_fill_log` (
  534. `id` int(11) NOT NULL AUTO_INCREMENT,
  535. `content` longtext NOT NULL,
  536. `order` int(11) NOT NULL,
  537. `main_id` int(11) NOT NULL,
  538. PRIMARY KEY (`id`),
  539. KEY `practise_answer_fill_main_id_dced144a_fk_practise_` (`main_id`),
  540. CONSTRAINT `practise_answer_fill_main_id_dced144a_fk_practise_` FOREIGN KEY (`main_id`) REFERENCES `practise_answer_log` (`id`)
  541. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  542. -- ----------------------------
  543. -- Records of practise_answer_fill_log
  544. -- ----------------------------
  545. -- ----------------------------
  546. -- Table structure for `practise_answer_log`
  547. -- ----------------------------
  548. DROP TABLE IF EXISTS `practise_answer_log`;
  549. CREATE TABLE `practise_answer_log` (
  550. `id` int(11) NOT NULL AUTO_INCREMENT,
  551. `status` smallint(5) unsigned DEFAULT NULL,
  552. `main_id` int(11) NOT NULL,
  553. `question_id` int(11) NOT NULL,
  554. PRIMARY KEY (`id`),
  555. KEY `practise_answer_log_main_id_df7c7f82_fk_practise_log_id` (`main_id`),
  556. KEY `practise_answer_log_question_id_813be9e8_fk_exam_question_id` (`question_id`),
  557. CONSTRAINT `practise_answer_log_main_id_df7c7f82_fk_practise_log_id` FOREIGN KEY (`main_id`) REFERENCES `practise_log` (`id`),
  558. CONSTRAINT `practise_answer_log_question_id_813be9e8_fk_exam_question_id` FOREIGN KEY (`question_id`) REFERENCES `exam_question` (`id`)
  559. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  560. -- ----------------------------
  561. -- Records of practise_answer_log
  562. -- ----------------------------
  563. -- ----------------------------
  564. -- Table structure for `practise_answer_option_log`
  565. -- ----------------------------
  566. DROP TABLE IF EXISTS `practise_answer_option_log`;
  567. CREATE TABLE `practise_answer_option_log` (
  568. `id` int(11) NOT NULL AUTO_INCREMENT,
  569. `main_id` int(11) NOT NULL,
  570. `option_id` int(11) NOT NULL,
  571. PRIMARY KEY (`id`),
  572. KEY `practise_answer_opti_main_id_53e10538_fk_practise_` (`main_id`),
  573. KEY `practise_answer_opti_option_id_07194fed_fk_exam_ques` (`option_id`),
  574. CONSTRAINT `practise_answer_opti_main_id_53e10538_fk_practise_` FOREIGN KEY (`main_id`) REFERENCES `practise_answer_log` (`id`),
  575. CONSTRAINT `practise_answer_opti_option_id_07194fed_fk_exam_ques` FOREIGN KEY (`option_id`) REFERENCES `exam_question_option` (`id`)
  576. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  577. -- ----------------------------
  578. -- Records of practise_answer_option_log
  579. -- ----------------------------
  580. -- ----------------------------
  581. -- Table structure for `practise_error_book`
  582. -- ----------------------------
  583. DROP TABLE IF EXISTS `practise_error_book`;
  584. CREATE TABLE `practise_error_book` (
  585. `id` int(11) NOT NULL AUTO_INCREMENT,
  586. `last_time` datetime(6) NOT NULL,
  587. `wrong_count` int(11) NOT NULL,
  588. `create_user_id` int(11) NOT NULL,
  589. `last_answer_log_id` int(11) NOT NULL,
  590. `question_id` int(11) NOT NULL,
  591. PRIMARY KEY (`id`),
  592. KEY `practise_error_book_create_user_id_db579338_fk_staff_user_id` (`create_user_id`),
  593. KEY `practise_error_book_last_answer_log_id_71418026_fk_exam_answ` (`last_answer_log_id`),
  594. KEY `practise_error_book_question_id_b58245d7_fk_exam_question_id` (`question_id`),
  595. CONSTRAINT `practise_error_book_create_user_id_db579338_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  596. CONSTRAINT `practise_error_book_last_answer_log_id_71418026_fk_exam_answ` FOREIGN KEY (`last_answer_log_id`) REFERENCES `exam_answer_log` (`id`),
  597. CONSTRAINT `practise_error_book_question_id_b58245d7_fk_exam_question_id` FOREIGN KEY (`question_id`) REFERENCES `exam_question` (`id`)
  598. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  599. -- ----------------------------
  600. -- Records of practise_error_book
  601. -- ----------------------------
  602. -- ----------------------------
  603. -- Table structure for `practise_log`
  604. -- ----------------------------
  605. DROP TABLE IF EXISTS `practise_log`;
  606. CREATE TABLE `practise_log` (
  607. `id` int(11) NOT NULL AUTO_INCREMENT,
  608. `type` smallint(5) unsigned NOT NULL,
  609. `create_time` datetime(6) NOT NULL,
  610. `submit_time` datetime(6) DEFAULT NULL,
  611. `right_count` int(11) NOT NULL,
  612. `wrong_count` int(11) NOT NULL,
  613. `total_count` int(11) NOT NULL,
  614. `begin_answer_id` int(11) DEFAULT NULL,
  615. `chapter_id` int(11) DEFAULT NULL,
  616. `create_user_id` int(11) NOT NULL,
  617. `end_answer_id` int(11) DEFAULT NULL,
  618. `subject_id` int(11) NOT NULL,
  619. PRIMARY KEY (`id`),
  620. KEY `practise_log_begin_answer_id_934c990a_fk_practise_answer_log_id` (`begin_answer_id`),
  621. KEY `practise_log_chapter_id_69d2fc81_fk_base_chapter_id` (`chapter_id`),
  622. KEY `practise_log_create_user_id_e0e2795c_fk_staff_user_id` (`create_user_id`),
  623. KEY `practise_log_end_answer_id_8c9de0ae_fk_practise_answer_log_id` (`end_answer_id`),
  624. KEY `practise_log_subject_id_7608f3f5_fk_base_subject_id` (`subject_id`),
  625. CONSTRAINT `practise_log_begin_answer_id_934c990a_fk_practise_answer_log_id` FOREIGN KEY (`begin_answer_id`) REFERENCES `practise_answer_log` (`id`),
  626. CONSTRAINT `practise_log_chapter_id_69d2fc81_fk_base_chapter_id` FOREIGN KEY (`chapter_id`) REFERENCES `base_chapter` (`id`),
  627. CONSTRAINT `practise_log_create_user_id_e0e2795c_fk_staff_user_id` FOREIGN KEY (`create_user_id`) REFERENCES `staff_user` (`id`),
  628. CONSTRAINT `practise_log_end_answer_id_8c9de0ae_fk_practise_answer_log_id` FOREIGN KEY (`end_answer_id`) REFERENCES `practise_answer_log` (`id`),
  629. CONSTRAINT `practise_log_subject_id_7608f3f5_fk_base_subject_id` FOREIGN KEY (`subject_id`) REFERENCES `base_subject` (`id`)
  630. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  631. -- ----------------------------
  632. -- Records of practise_log
  633. -- ----------------------------
  634. -- ----------------------------
  635. -- Table structure for `staff_department`
  636. -- ----------------------------
  637. DROP TABLE IF EXISTS `staff_department`;
  638. CREATE TABLE `staff_department` (
  639. `id` int(11) NOT NULL AUTO_INCREMENT,
  640. `name` varchar(100) NOT NULL,
  641. `notes` varchar(500) DEFAULT NULL,
  642. `parent_id` int(11) DEFAULT NULL,
  643. `lft` int(11) NOT NULL,
  644. `rgt` int(11) NOT NULL,
  645. PRIMARY KEY (`id`)
  646. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  647. -- ----------------------------
  648. -- Records of staff_department
  649. -- ----------------------------
  650. -- ----------------------------
  651. -- Table structure for `staff_user`
  652. -- ----------------------------
  653. DROP TABLE IF EXISTS `staff_user`;
  654. CREATE TABLE `staff_user` (
  655. `id` int(11) NOT NULL AUTO_INCREMENT,
  656. `password` varchar(128) NOT NULL,
  657. `last_login` datetime(6) DEFAULT NULL,
  658. `is_superuser` tinyint(1) NOT NULL,
  659. `type` smallint(5) unsigned NOT NULL,
  660. `username` varchar(30) NOT NULL,
  661. `name` varchar(30) NOT NULL,
  662. `is_active` tinyint(1) NOT NULL,
  663. `date_joined` datetime(6) NOT NULL,
  664. `department_id` int(11) DEFAULT NULL,
  665. PRIMARY KEY (`id`),
  666. UNIQUE KEY `username` (`username`),
  667. UNIQUE KEY `staff_user_username_039485a3_uniq` (`username`),
  668. KEY `staff_user_department_id_aa13ac5f_fk_staff_department_id` (`department_id`),
  669. KEY `staff_user_date_joined_7681f7b6_idx` (`date_joined`),
  670. CONSTRAINT `staff_user_department_id_aa13ac5f_fk_staff_department_id` FOREIGN KEY (`department_id`) REFERENCES `staff_department` (`id`)
  671. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  672. -- ----------------------------
  673. -- Records of staff_user
  674. -- ----------------------------
  675. -- ----------------------------
  676. -- Table structure for `staff_user_groups`
  677. -- ----------------------------
  678. DROP TABLE IF EXISTS `staff_user_groups`;
  679. CREATE TABLE `staff_user_groups` (
  680. `id` int(11) NOT NULL AUTO_INCREMENT,
  681. `user_id` int(11) NOT NULL,
  682. `group_id` int(11) NOT NULL,
  683. PRIMARY KEY (`id`),
  684. UNIQUE KEY `staff_user_groups_user_id_group_id_7487dd55_uniq` (`user_id`,`group_id`),
  685. KEY `staff_user_groups_group_id_f268c67d_fk_auth_group_id` (`group_id`),
  686. CONSTRAINT `staff_user_groups_group_id_f268c67d_fk_auth_group_id` FOREIGN KEY (`group_id`) REFERENCES `auth_group` (`id`),
  687. CONSTRAINT `staff_user_groups_user_id_d6a7bab4_fk_staff_user_id` FOREIGN KEY (`user_id`) REFERENCES `staff_user` (`id`)
  688. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  689. -- ----------------------------
  690. -- Records of staff_user_groups
  691. -- ----------------------------
  692. -- ----------------------------
  693. -- Table structure for `staff_user_user_permissions`
  694. -- ----------------------------
  695. DROP TABLE IF EXISTS `staff_user_user_permissions`;
  696. CREATE TABLE `staff_user_user_permissions` (
  697. `id` int(11) NOT NULL AUTO_INCREMENT,
  698. `user_id` int(11) NOT NULL,
  699. `permission_id` int(11) NOT NULL,
  700. PRIMARY KEY (`id`),
  701. UNIQUE KEY `staff_user_user_permissions_user_id_permission_id_508e3d20_uniq` (`user_id`,`permission_id`),
  702. KEY `staff_user_user_perm_permission_id_f36572eb_fk_auth_perm` (`permission_id`),
  703. CONSTRAINT `staff_user_user_perm_permission_id_f36572eb_fk_auth_perm` FOREIGN KEY (`permission_id`) REFERENCES `auth_permission` (`id`),
  704. CONSTRAINT `staff_user_user_permissions_user_id_47d1712b_fk_staff_user_id` FOREIGN KEY (`user_id`) REFERENCES `staff_user` (`id`)
  705. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  706. -- ----------------------------
  707. -- Records of staff_user_user_permissions
  708. -- ----------------------------
  709. -- ----------------------------
  710. -- Table structure for `sys_log`
  711. -- ----------------------------
  712. DROP TABLE IF EXISTS `sys_log`;
  713. CREATE TABLE `sys_log` (
  714. `id` int(11) NOT NULL AUTO_INCREMENT,
  715. `type` smallint(5) unsigned NOT NULL,
  716. `description` varchar(1000) NOT NULL,
  717. `data` longtext,
  718. `create_time` datetime(6) NOT NULL,
  719. `user_id` int(11) DEFAULT NULL,
  720. PRIMARY KEY (`id`),
  721. KEY `sys_log_user_id_4b944456_fk_staff_user_id` (`user_id`),
  722. KEY `sys_log_create_time_type_78f30482_idx` (`create_time`,`type`),
  723. CONSTRAINT `sys_log_user_id_4b944456_fk_staff_user_id` FOREIGN KEY (`user_id`) REFERENCES `staff_user` (`id`)
  724. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  725. -- ----------------------------
  726. -- Records of sys_log
  727. -- ----------------------------