davinci.sql 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708
  1. SET NAMES utf8mb4;
  2. SET FOREIGN_KEY_CHECKS = 0;
  3. -- ----------------------------
  4. -- Table structure for cron_job
  5. -- ----------------------------
  6. DROP TABLE IF EXISTS `cron_job`;
  7. CREATE TABLE `cron_job`
  8. (
  9. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  10. `name` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  11. `project_id` bigint(20) NOT NULL,
  12. `job_type` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  13. `job_status` varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
  14. `cron_expression` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  15. `start_date` datetime NOT NULL,
  16. `end_date` datetime NOT NULL,
  17. `config` text COLLATE utf8_unicode_ci NOT NULL,
  18. `description` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  19. `exec_log` text COLLATE utf8_unicode_ci,
  20. `create_by` bigint(20) NOT NULL,
  21. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  22. `update_by` bigint(20) DEFAULT NULL,
  23. `update_time` timestamp NULL DEFAULT NULL,
  24. `parent_id` bigint(20) DEFAULT NULL,
  25. `full_parent_id` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL,
  26. `is_folder` tinyint(1) DEFAULT NULL,
  27. `index` int(5) DEFAULT NULL,
  28. PRIMARY KEY (`id`) USING BTREE,
  29. UNIQUE KEY `idx_name_project` (`name`,`project_id`) USING BTREE
  30. ) ENGINE = InnoDB
  31. DEFAULT CHARSET = utf8
  32. COLLATE = utf8_unicode_ci;
  33. -- ----------------------------
  34. -- Table structure for dashboard
  35. -- ----------------------------
  36. DROP TABLE IF EXISTS `dashboard`;
  37. CREATE TABLE `dashboard`
  38. (
  39. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  40. `name` varchar(255) NOT NULL,
  41. `dashboard_portal_id` bigint(20) NOT NULL,
  42. `type` smallint(1) NOT NULL,
  43. `index` int(4) NOT NULL,
  44. `parent_id` bigint(20) NOT NULL DEFAULT '0',
  45. `config` text,
  46. `full_parent_Id` varchar(100) DEFAULT NULL,
  47. `create_by` bigint(20) DEFAULT NULL,
  48. `create_time` datetime DEFAULT NULL,
  49. `update_by` bigint(20) DEFAULT NULL,
  50. `update_time` datetime DEFAULT NULL,
  51. PRIMARY KEY (`id`) USING BTREE,
  52. KEY `idx_portal_id` (`dashboard_portal_id`) USING BTREE,
  53. KEY `idx_parent_id` (`parent_id`) USING BTREE
  54. ) ENGINE = InnoDB
  55. DEFAULT CHARSET = utf8;
  56. -- ----------------------------
  57. -- Table structure for dashboard_portal
  58. -- ----------------------------
  59. DROP TABLE IF EXISTS `dashboard_portal`;
  60. CREATE TABLE `dashboard_portal`
  61. (
  62. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  63. `name` varchar(255) NOT NULL,
  64. `description` varchar(255) DEFAULT NULL,
  65. `project_id` bigint(20) NOT NULL,
  66. `avatar` varchar(255) DEFAULT NULL,
  67. `publish` tinyint(1) NOT NULL DEFAULT '0',
  68. `create_by` bigint(20) DEFAULT NULL,
  69. `create_time` datetime DEFAULT NULL,
  70. `update_by` bigint(20) DEFAULT NULL,
  71. `update_time` datetime DEFAULT NULL,
  72. PRIMARY KEY (`id`) USING BTREE,
  73. KEY `idx_project_id` (`project_id`) USING BTREE
  74. ) ENGINE = InnoDB
  75. DEFAULT CHARSET = utf8;
  76. -- ----------------------------
  77. -- Table structure for display
  78. -- ----------------------------
  79. DROP TABLE IF EXISTS `display`;
  80. CREATE TABLE `display`
  81. (
  82. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  83. `name` varchar(255) NOT NULL,
  84. `description` varchar(255) DEFAULT NULL,
  85. `project_id` bigint(20) NOT NULL,
  86. `avatar` varchar(255) DEFAULT NULL,
  87. `publish` tinyint(1) NOT NULL,
  88. `config` text NULL,
  89. `create_by` bigint(20) DEFAULT NULL,
  90. `create_time` datetime DEFAULT NULL,
  91. `update_by` bigint(20) DEFAULT NULL,
  92. `update_time` datetime DEFAULT NULL,
  93. PRIMARY KEY (`id`) USING BTREE,
  94. KEY `idx_project_id` (`project_id`) USING BTREE
  95. ) ENGINE = InnoDB
  96. DEFAULT CHARSET = utf8;
  97. -- ----------------------------
  98. -- Table structure for display_slide
  99. -- ----------------------------
  100. DROP TABLE IF EXISTS `display_slide`;
  101. CREATE TABLE `display_slide`
  102. (
  103. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  104. `display_id` bigint(20) NOT NULL,
  105. `index` int(12) NOT NULL,
  106. `config` text NOT NULL,
  107. `create_by` bigint(20) DEFAULT NULL,
  108. `create_time` datetime DEFAULT NULL,
  109. `update_by` bigint(20) DEFAULT NULL,
  110. `update_time` datetime DEFAULT NULL,
  111. PRIMARY KEY (`id`) USING BTREE,
  112. KEY `idx_display_id` (`display_id`) USING BTREE
  113. ) ENGINE = InnoDB
  114. DEFAULT CHARSET = utf8;
  115. -- ----------------------------
  116. -- Table structure for download_record
  117. -- ----------------------------
  118. DROP TABLE IF EXISTS `download_record`;
  119. CREATE TABLE `download_record`
  120. (
  121. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  122. `name` varchar(255) NOT NULL,
  123. `user_id` bigint(20) NOT NULL,
  124. `path` varchar(255) DEFAULT NULL,
  125. `status` smallint(1) NOT NULL,
  126. `create_time` datetime NOT NULL,
  127. `last_download_time` datetime DEFAULT NULL,
  128. PRIMARY KEY (`id`) USING BTREE,
  129. KEY `idx_user` (`user_id`) USING BTREE
  130. ) ENGINE = InnoDB
  131. DEFAULT CHARSET = utf8mb4;
  132. -- ----------------------------
  133. -- Table structure for favorite
  134. -- ----------------------------
  135. DROP TABLE IF EXISTS `favorite`;
  136. CREATE TABLE `favorite`
  137. (
  138. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  139. `user_id` bigint(20) NOT NULL,
  140. `project_id` bigint(20) NOT NULL,
  141. `create_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
  142. PRIMARY KEY (`id`) USING BTREE,
  143. UNIQUE KEY `idx_user_project` (`user_id`, `project_id`) USING BTREE
  144. ) ENGINE = InnoDB
  145. DEFAULT CHARSET = utf8;
  146. -- ----------------------------
  147. -- Table structure for mem_dashboard_widget
  148. -- ----------------------------
  149. DROP TABLE IF EXISTS `mem_dashboard_widget`;
  150. CREATE TABLE `mem_dashboard_widget`
  151. (
  152. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  153. `alias` varchar(30) NULL,
  154. `dashboard_id` bigint(20) NOT NULL,
  155. `widget_Id` bigint(20) DEFAULT NULL,
  156. `x` int(12) NOT NULL,
  157. `y` int(12) NOT NULL,
  158. `width` int(12) NOT NULL,
  159. `height` int(12) NOT NULL,
  160. `polling` tinyint(1) NOT NULL DEFAULT '0',
  161. `frequency` int(12) DEFAULT NULL,
  162. `config` text,
  163. `create_by` bigint(20) DEFAULT NULL,
  164. `create_time` datetime DEFAULT NULL,
  165. `update_by` bigint(20) DEFAULT NULL,
  166. `update_time` datetime DEFAULT NULL,
  167. PRIMARY KEY (`id`) USING BTREE,
  168. KEY `idx_dashboard_id` (`dashboard_id`) USING BTREE,
  169. KEY `idx_widget_id` (`widget_Id`) USING BTREE
  170. ) ENGINE = InnoDB
  171. DEFAULT CHARSET = utf8;
  172. -- ----------------------------
  173. -- Table structure for mem_display_slide_widget
  174. -- ----------------------------
  175. DROP TABLE IF EXISTS `mem_display_slide_widget`;
  176. CREATE TABLE `mem_display_slide_widget`
  177. (
  178. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  179. `display_slide_id` bigint(20) NOT NULL,
  180. `widget_id` bigint(20) DEFAULT NULL,
  181. `name` varchar(255) NOT NULL,
  182. `params` text NOT NULL,
  183. `type` smallint(1) NOT NULL,
  184. `sub_type` smallint(2) DEFAULT NULL,
  185. `index` int(12) NOT NULL DEFAULT '0',
  186. `create_by` bigint(20) DEFAULT NULL,
  187. `create_time` datetime DEFAULT NULL,
  188. `update_by` bigint(20) DEFAULT NULL,
  189. `update_time` datetime DEFAULT NULL,
  190. PRIMARY KEY (`id`) USING BTREE,
  191. KEY `idx_slide_id` (`display_slide_id`) USING BTREE,
  192. KEY `idx_widget_id` (`widget_id`) USING BTREE
  193. ) ENGINE = InnoDB
  194. DEFAULT CHARSET = utf8;
  195. -- ----------------------------
  196. -- Table structure for organization
  197. -- ----------------------------
  198. DROP TABLE IF EXISTS `organization`;
  199. CREATE TABLE `organization`
  200. (
  201. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  202. `name` varchar(255) NOT NULL,
  203. `description` varchar(255) DEFAULT NULL,
  204. `avatar` varchar(255) DEFAULT NULL,
  205. `user_id` bigint(20) NOT NULL,
  206. `project_num` int(20) DEFAULT '0',
  207. `member_num` int(20) DEFAULT '0',
  208. `role_num` int(20) DEFAULT '0',
  209. `allow_create_project` tinyint(1) DEFAULT '1',
  210. `member_permission` smallint(1) NOT NULL DEFAULT '0',
  211. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  212. `create_by` bigint(20) NOT NULL DEFAULT '0',
  213. `update_time` timestamp NULL,
  214. `update_by` bigint(20) DEFAULT NULL,
  215. PRIMARY KEY (`id`) USING BTREE,
  216. KEY `idx_user_id` (`user_id`),
  217. KEY `idx_allow_create_project` (`allow_create_project`),
  218. KEY `idx_member_permission` (`member_permission`)
  219. ) ENGINE = InnoDB
  220. DEFAULT CHARSET = utf8;
  221. -- ----------------------------
  222. -- Table structure for platform
  223. -- ----------------------------
  224. DROP TABLE IF EXISTS `platform`;
  225. CREATE TABLE `platform`
  226. (
  227. `id` bigint(20) NOT NULL,
  228. `name` varchar(255) NOT NULL,
  229. `platform` varchar(255) NOT NULL,
  230. `code` varchar(32) NOT NULL,
  231. `checkCode` varchar(255) DEFAULT NULL,
  232. `checkSystemToken` varchar(255) DEFAULT NULL,
  233. `checkUrl` varchar(255) DEFAULT NULL,
  234. `alternateField1` varchar(255) DEFAULT NULL,
  235. `alternateField2` varchar(255) DEFAULT NULL,
  236. `alternateField3` varchar(255) DEFAULT NULL,
  237. `alternateField4` varchar(255) DEFAULT NULL,
  238. `alternateField5` varchar(255) DEFAULT NULL,
  239. PRIMARY KEY (`id`) USING BTREE
  240. ) ENGINE = InnoDB
  241. DEFAULT CHARSET = utf8;
  242. -- ----------------------------
  243. -- Table structure for project
  244. -- ----------------------------
  245. DROP TABLE IF EXISTS `project`;
  246. CREATE TABLE `project`
  247. (
  248. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  249. `name` varchar(255) NOT NULL,
  250. `description` varchar(255) DEFAULT NULL,
  251. `pic` varchar(255) DEFAULT NULL,
  252. `org_id` bigint(20) NOT NULL,
  253. `user_id` bigint(20) NOT NULL,
  254. `visibility` tinyint(1) DEFAULT '1',
  255. `star_num` int(11) DEFAULT '0',
  256. `is_transfer` tinyint(1) NOT NULL DEFAULT '0',
  257. `initial_org_id` bigint(20) NOT NULL,
  258. `create_by` bigint(20) DEFAULT NULL,
  259. `create_time` datetime DEFAULT NULL,
  260. `update_by` bigint(20) DEFAULT NULL,
  261. `update_time` datetime DEFAULT NULL,
  262. PRIMARY KEY (`id`) USING BTREE,
  263. KEY `idx_org_id` (`org_id`),
  264. KEY `idx_user_id` (`user_id`),
  265. KEY `idx_visibility` (`visibility`)
  266. ) ENGINE = InnoDB
  267. DEFAULT CHARSET = utf8;
  268. -- ----------------------------
  269. -- Table structure for rel_project_admin
  270. -- ----------------------------
  271. DROP TABLE IF EXISTS `rel_project_admin`;
  272. CREATE TABLE `rel_project_admin`
  273. (
  274. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  275. `project_id` bigint(20) NOT NULL,
  276. `user_id` bigint(20) NOT NULL,
  277. `create_by` bigint(20) DEFAULT NULL,
  278. `create_time` datetime DEFAULT NULL,
  279. `update_by` bigint(20) DEFAULT NULL,
  280. `update_time` datetime DEFAULT NULL,
  281. PRIMARY KEY (`id`) USING BTREE,
  282. UNIQUE KEY `idx_project_user` (`project_id`, `user_id`) USING BTREE
  283. ) ENGINE = InnoDB
  284. DEFAULT CHARSET = utf8mb4 COMMENT ='project admin表';
  285. -- ----------------------------
  286. -- Table structure for rel_role_dashboard
  287. -- ----------------------------
  288. DROP TABLE IF EXISTS `rel_role_dashboard`;
  289. CREATE TABLE `rel_role_dashboard`
  290. (
  291. `role_id` bigint(20) NOT NULL,
  292. `dashboard_id` bigint(20) NOT NULL,
  293. `visible` tinyint(1) NOT NULL DEFAULT '0',
  294. `create_by` bigint(20) DEFAULT NULL,
  295. `create_time` datetime DEFAULT NULL,
  296. `update_by` bigint(20) DEFAULT NULL,
  297. `update_time` datetime DEFAULT NULL,
  298. PRIMARY KEY (`role_id`, `dashboard_id`) USING BTREE
  299. ) ENGINE = InnoDB
  300. DEFAULT CHARSET = utf8mb4;
  301. -- ----------------------------
  302. -- Table structure for rel_role_display
  303. -- ----------------------------
  304. DROP TABLE IF EXISTS `rel_role_display`;
  305. CREATE TABLE `rel_role_display`
  306. (
  307. `role_id` bigint(20) NOT NULL,
  308. `display_id` bigint(20) NOT NULL,
  309. `visible` tinyint(1) NOT NULL DEFAULT '0',
  310. `create_by` bigint(20) DEFAULT NULL,
  311. `create_time` datetime DEFAULT NULL,
  312. `update_by` bigint(20) DEFAULT NULL,
  313. `update_time` datetime DEFAULT NULL,
  314. PRIMARY KEY (`role_id`, `display_id`) USING BTREE
  315. ) ENGINE = InnoDB
  316. DEFAULT CHARSET = utf8mb4;
  317. -- ----------------------------
  318. -- Table structure for rel_role_portal
  319. -- ----------------------------
  320. DROP TABLE IF EXISTS `rel_role_portal`;
  321. CREATE TABLE `rel_role_portal`
  322. (
  323. `role_id` bigint(20) NOT NULL,
  324. `portal_id` bigint(20) NOT NULL,
  325. `visible` tinyint(1) NOT NULL DEFAULT '0',
  326. `create_by` bigint(20) DEFAULT NULL,
  327. `create_time` datetime DEFAULT NULL,
  328. `update_by` bigint(20) DEFAULT NULL,
  329. `update_time` datetime DEFAULT NULL,
  330. PRIMARY KEY (`role_id`, `portal_id`) USING BTREE
  331. ) ENGINE = InnoDB
  332. DEFAULT CHARSET = utf8mb4;
  333. -- ----------------------------
  334. -- Table structure for rel_role_project
  335. -- ----------------------------
  336. DROP TABLE IF EXISTS `rel_role_project`;
  337. CREATE TABLE `rel_role_project`
  338. (
  339. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  340. `project_id` bigint(20) NOT NULL,
  341. `role_id` bigint(20) NOT NULL,
  342. `source_permission` smallint(1) NOT NULL DEFAULT '1',
  343. `view_permission` smallint(1) NOT NULL DEFAULT '1',
  344. `widget_permission` smallint(1) NOT NULL DEFAULT '1',
  345. `viz_permission` smallint(1) NOT NULL DEFAULT '1',
  346. `schedule_permission` smallint(1) NOT NULL DEFAULT '1',
  347. `share_permission` tinyint(1) NOT NULL DEFAULT '0',
  348. `download_permission` tinyint(1) NOT NULL DEFAULT '0',
  349. `create_by` bigint(20) DEFAULT NULL,
  350. `create_time` datetime DEFAULT NULL,
  351. `update_by` bigint(20) DEFAULT NULL,
  352. `update_time` datetime DEFAULT NULL,
  353. PRIMARY KEY (`id`) USING BTREE,
  354. UNIQUE KEY `idx_role_project` (`project_id`, `role_id`) USING BTREE
  355. ) ENGINE = InnoDB
  356. DEFAULT CHARSET = utf8mb4;
  357. -- ----------------------------
  358. -- Table structure for rel_role_slide
  359. -- ----------------------------
  360. DROP TABLE IF EXISTS `rel_role_slide`;
  361. CREATE TABLE `rel_role_slide`
  362. (
  363. `role_id` bigint(20) NOT NULL,
  364. `slide_id` bigint(20) NOT NULL,
  365. `visible` tinyint(1) NOT NULL DEFAULT '0',
  366. `create_by` bigint(20) DEFAULT NULL,
  367. `create_time` datetime DEFAULT NULL,
  368. `update_by` bigint(20) DEFAULT NULL,
  369. `update_time` datetime DEFAULT NULL,
  370. PRIMARY KEY (`role_id`, `slide_id`) USING BTREE
  371. ) ENGINE = InnoDB
  372. DEFAULT CHARSET = utf8mb4;
  373. -- ----------------------------
  374. -- Table structure for rel_role_user
  375. -- ----------------------------
  376. DROP TABLE IF EXISTS `rel_role_user`;
  377. CREATE TABLE `rel_role_user`
  378. (
  379. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  380. `user_id` bigint(20) NOT NULL,
  381. `role_id` bigint(20) NOT NULL,
  382. `create_by` bigint(20) DEFAULT NULL,
  383. `create_time` datetime DEFAULT NULL,
  384. `update_by` bigint(20) DEFAULT NULL,
  385. `update_time` datetime DEFAULT NULL,
  386. PRIMARY KEY (`id`) USING BTREE,
  387. UNIQUE KEY `idx_role_user` (`user_id`, `role_id`) USING BTREE
  388. ) ENGINE = InnoDB
  389. DEFAULT CHARSET = utf8mb4;
  390. -- ----------------------------
  391. -- Table structure for rel_role_view
  392. -- ----------------------------
  393. DROP TABLE IF EXISTS `rel_role_view`;
  394. CREATE TABLE `rel_role_view`
  395. (
  396. `view_id` bigint(20) NOT NULL,
  397. `role_id` bigint(20) NOT NULL,
  398. `row_auth` text,
  399. `column_auth` text,
  400. `create_by` bigint(20) DEFAULT NULL,
  401. `create_time` datetime DEFAULT NULL,
  402. `update_by` bigint(20) DEFAULT NULL,
  403. `update_time` datetime DEFAULT NULL,
  404. PRIMARY KEY (`view_id`, `role_id`) USING BTREE
  405. ) ENGINE = InnoDB
  406. DEFAULT CHARSET = utf8;
  407. -- ----------------------------
  408. -- Table structure for rel_user_organization
  409. -- ----------------------------
  410. DROP TABLE IF EXISTS `rel_user_organization`;
  411. CREATE TABLE `rel_user_organization`
  412. (
  413. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  414. `org_id` bigint(20) NOT NULL,
  415. `user_id` bigint(20) NOT NULL,
  416. `role` smallint(1) NOT NULL DEFAULT '0',
  417. `create_by` bigint(20) DEFAULT NULL,
  418. `create_time` datetime DEFAULT NULL,
  419. `update_by` bigint(20) DEFAULT NULL,
  420. `update_time` datetime DEFAULT NULL,
  421. PRIMARY KEY (`id`) USING BTREE,
  422. UNIQUE KEY `idx_org_user` (`org_id`, `user_id`) USING BTREE,
  423. KEY `idx_role` (`role`)
  424. ) ENGINE = InnoDB
  425. DEFAULT CHARSET = utf8;
  426. -- ----------------------------
  427. -- Table structure for role
  428. -- ----------------------------
  429. DROP TABLE IF EXISTS `role`;
  430. CREATE TABLE `role`
  431. (
  432. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  433. `org_id` bigint(20) NOT NULL,
  434. `name` varchar(100) NOT NULL,
  435. `description` varchar(255) DEFAULT NULL,
  436. `create_by` bigint(20) DEFAULT NULL,
  437. `create_time` datetime DEFAULT NULL,
  438. `update_by` bigint(20) DEFAULT NULL,
  439. `update_time` datetime DEFAULT NULL,
  440. `avatar` varchar(255) DEFAULT NULL,
  441. PRIMARY KEY (`id`) USING BTREE,
  442. KEY `idx_org_id` (`org_id`) USING BTREE
  443. ) ENGINE = InnoDB
  444. DEFAULT CHARSET = utf8mb4 COMMENT ='权限表';
  445. -- ----------------------------
  446. -- Table structure for source
  447. -- ----------------------------
  448. DROP TABLE IF EXISTS `source`;
  449. CREATE TABLE `source`
  450. (
  451. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  452. `name` varchar(255) NOT NULL,
  453. `description` varchar(255) DEFAULT NULL,
  454. `pId` varchar(255) DEFAULT NULL,
  455. `config` text NOT NULL,
  456. `type` varchar(10) NOT NULL,
  457. `project_id` bigint(20) NOT NULL,
  458. `create_by` bigint(20) DEFAULT NULL,
  459. `create_time` datetime DEFAULT NULL,
  460. `update_by` bigint(20) DEFAULT NULL,
  461. `update_time` datetime DEFAULT NULL,
  462. `parent_id` bigint(20) DEFAULT NULL,
  463. `full_parent_id` varchar(255) DEFAULT NULL,
  464. `is_folder` tinyint(1) DEFAULT NULL,
  465. `index` int(5) DEFAULT NULL,
  466. PRIMARY KEY (`id`) USING BTREE,
  467. KEY `idx_project_id` (`project_id`) USING BTREE
  468. ) ENGINE = InnoDB
  469. DEFAULT CHARSET = utf8;
  470. -- ----------------------------
  471. -- Table structure for star
  472. -- ----------------------------
  473. DROP TABLE IF EXISTS `star`;
  474. CREATE TABLE `star`
  475. (
  476. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  477. `target` varchar(20) NOT NULL,
  478. `target_id` bigint(20) NOT NULL,
  479. `user_id` bigint(20) NOT NULL,
  480. `star_time` datetime NOT NULL ON UPDATE CURRENT_TIMESTAMP,
  481. PRIMARY KEY (`id`) USING BTREE,
  482. KEY `idx_target_id` (`target_id`) USING BTREE,
  483. KEY `idx_user_id` (`user_id`) USING BTREE
  484. ) ENGINE = InnoDB
  485. DEFAULT CHARSET = utf8;
  486. -- ----------------------------
  487. -- Table structure for user
  488. -- ----------------------------
  489. DROP TABLE IF EXISTS `user`;
  490. CREATE TABLE `user`
  491. (
  492. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  493. `email` varchar(255) NOT NULL,
  494. `username` varchar(255) NOT NULL,
  495. `password` varchar(255) NOT NULL,
  496. `admin` tinyint(1) NOT NULL,
  497. `active` tinyint(1) DEFAULT NULL,
  498. `name` varchar(255) DEFAULT NULL,
  499. `description` varchar(255) DEFAULT NULL,
  500. `department` varchar(255) DEFAULT NULL,
  501. `avatar` varchar(255) DEFAULT NULL,
  502. `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  503. `create_by` bigint(20) NOT NULL DEFAULT '0',
  504. `update_time` timestamp NULL,
  505. `update_by` bigint(20) DEFAULT NULL,
  506. PRIMARY KEY (`id`) USING BTREE,
  507. KEY `idx_email` (`email`),
  508. KEY `idx_username` (`username`)
  509. ) ENGINE = InnoDB
  510. DEFAULT CHARSET = utf8;
  511. -- ----------------------------
  512. -- Table structure for view
  513. -- ----------------------------
  514. DROP TABLE IF EXISTS `view`;
  515. CREATE TABLE `view`
  516. (
  517. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  518. `name` varchar(255) NOT NULL,
  519. `description` varchar(255) DEFAULT NULL,
  520. `project_id` bigint(20) NOT NULL,
  521. `source_id` bigint(20) NOT NULL,
  522. `sql` text,
  523. `model` text,
  524. `variable` text,
  525. `config` text,
  526. `create_by` bigint(20) DEFAULT NULL,
  527. `create_time` datetime DEFAULT NULL,
  528. `update_by` bigint(20) DEFAULT NULL,
  529. `update_time` datetime DEFAULT NULL,
  530. `parent_id` bigint(20) DEFAULT NULL,
  531. `full_parent_id` varchar(255) DEFAULT NULL,
  532. `is_folder` tinyint(1) DEFAULT NULL,
  533. `index` int(5) DEFAULT NULL,
  534. PRIMARY KEY (`id`) USING BTREE,
  535. KEY `idx_project_id` (`project_id`) USING BTREE
  536. ) ENGINE = InnoDB
  537. DEFAULT CHARSET = utf8;
  538. -- ----------------------------
  539. -- Table structure for widget
  540. -- ----------------------------
  541. DROP TABLE IF EXISTS `widget`;
  542. CREATE TABLE `widget`
  543. (
  544. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  545. `name` varchar(255) NOT NULL,
  546. `description` varchar(255) DEFAULT NULL,
  547. `view_id` bigint(20) NOT NULL,
  548. `project_id` bigint(20) NOT NULL,
  549. `type` bigint(20) NOT NULL,
  550. `publish` tinyint(1) NOT NULL,
  551. `config` longtext NOT NULL,
  552. `create_by` bigint(20) DEFAULT NULL,
  553. `create_time` datetime DEFAULT NULL,
  554. `update_by` bigint(20) DEFAULT NULL,
  555. `update_time` datetime DEFAULT NULL,
  556. `parent_id` bigint(20) DEFAULT NULL,
  557. `full_parent_id` varchar(255) DEFAULT NULL,
  558. `is_folder` tinyint(1) DEFAULT NULL,
  559. `index` int(5) DEFAULT NULL,
  560. PRIMARY KEY (`id`) USING BTREE,
  561. KEY `idx_project_id` (`project_id`) USING BTREE,
  562. KEY `idx_view_id` (`view_id`) USING BTREE
  563. ) ENGINE = InnoDB
  564. DEFAULT CHARSET = utf8;
  565. DROP TABLE IF EXISTS `rel_role_display_slide_widget`;
  566. CREATE TABLE `rel_role_display_slide_widget`
  567. (
  568. `role_id` bigint(20) NOT NULL,
  569. `mem_display_slide_widget_id` bigint(20) NOT NULL,
  570. `visible` tinyint(1) NOT NULL DEFAULT '0',
  571. `create_by` bigint(20) DEFAULT NULL,
  572. `create_time` datetime DEFAULT NULL,
  573. `update_by` bigint(20) DEFAULT NULL,
  574. `update_time` datetime DEFAULT NULL,
  575. PRIMARY KEY (`role_id`, `mem_display_slide_widget_id`) USING BTREE
  576. ) ENGINE = InnoDB
  577. DEFAULT CHARSET = utf8mb4;
  578. DROP TABLE IF EXISTS `rel_role_dashboard_widget`;
  579. CREATE TABLE `rel_role_dashboard_widget`
  580. (
  581. `role_id` bigint(20) NOT NULL,
  582. `mem_dashboard_widget_id` bigint(20) NOT NULL,
  583. `visible` tinyint(1) NOT NULL DEFAULT '0',
  584. `create_by` bigint(20) DEFAULT NULL,
  585. `create_time` datetime DEFAULT NULL,
  586. `update_by` bigint(20) DEFAULT NULL,
  587. `update_time` datetime DEFAULT NULL,
  588. PRIMARY KEY (`role_id`, `mem_dashboard_widget_id`) USING BTREE
  589. ) ENGINE = InnoDB
  590. DEFAULT CHARSET = utf8mb4;
  591. DROP TABLE IF EXISTS `davinci_statistic_visitor_operation`;
  592. CREATE TABLE `davinci_statistic_visitor_operation` (
  593. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  594. `user_id` bigint(20) DEFAULT NULL,
  595. `email` varchar(255) DEFAULT NULL,
  596. `action` varchar(255) DEFAULT NULL COMMENT 'login/visit/initial/sync/search/linkage/drill/download/print',
  597. `org_id` bigint(20) DEFAULT NULL,
  598. `project_id` bigint(20) DEFAULT NULL,
  599. `project_name` varchar(255) DEFAULT NULL,
  600. `viz_type` varchar(255) DEFAULT NULL COMMENT 'dashboard/display',
  601. `viz_id` bigint(20) DEFAULT NULL,
  602. `viz_name` varchar(255) DEFAULT NULL,
  603. `sub_viz_id` bigint(20) DEFAULT NULL,
  604. `sub_viz_name` varchar(255) DEFAULT NULL,
  605. `widget_id` bigint(20) DEFAULT NULL,
  606. `widget_name` varchar(255) DEFAULT NULL,
  607. `variables` varchar(500) DEFAULT NULL,
  608. `filters` varchar(500) DEFAULT NULL,
  609. `groups` varchar(500) DEFAULT NULL,
  610. `create_time` timestamp NULL DEFAULT NULL,
  611. PRIMARY KEY (`id`) USING BTREE
  612. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  613. DROP TABLE IF EXISTS `davinci_statistic_terminal`;
  614. CREATE TABLE `davinci_statistic_terminal` (
  615. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  616. `user_id` bigint(20) DEFAULT NULL,
  617. `email` varchar(255) DEFAULT NULL,
  618. `browser_name` varchar(255) DEFAULT NULL,
  619. `browser_version` varchar(255) DEFAULT NULL,
  620. `engine_name` varchar(255) DEFAULT NULL,
  621. `engine_version` varchar(255) DEFAULT NULL,
  622. `os_name` varchar(255) DEFAULT NULL,
  623. `os_version` varchar(255) DEFAULT NULL,
  624. `device_model` varchar(255) DEFAULT NULL,
  625. `device_type` varchar(255) DEFAULT NULL,
  626. `device_vendor` varchar(255) DEFAULT NULL,
  627. `cpu_architecture` varchar(255) DEFAULT NULL,
  628. `create_time` timestamp NULL DEFAULT NULL,
  629. PRIMARY KEY (`id`) USING BTREE
  630. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  631. DROP TABLE IF EXISTS `davinci_statistic_duration`;
  632. CREATE TABLE `davinci_statistic_duration`
  633. (
  634. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  635. `user_id` bigint(20) DEFAULT NULL,
  636. `email` varchar(255) DEFAULT NULL,
  637. `org_id` bigint(20) DEFAULT NULL COMMENT '报表关联组织ID',
  638. `project_id` bigint(20) DEFAULT NULL COMMENT '报表关联项目ID',
  639. `project_name` varchar(255) DEFAULT NULL COMMENT '报表关联项目名称',
  640. `viz_type` varchar(10) DEFAULT NULL COMMENT '报表关联应用类型(dashboard/display)',
  641. `viz_id` bigint(20) DEFAULT NULL COMMENT '报表关联应用ID',
  642. `viz_name` varchar(255) DEFAULT NULL COMMENT '报表关联应用名称',
  643. `sub_viz_id` bigint(20) DEFAULT NULL COMMENT '报表ID',
  644. `sub_viz_name` varchar(255) DEFAULT NULL COMMENT '报表名称',
  645. `start_time` timestamp NULL DEFAULT NULL,
  646. `end_time` timestamp NULL DEFAULT NULL,
  647. PRIMARY KEY (`id`) USING BTREE
  648. ) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
  649. DROP TABLE IF EXISTS `share_download_record`;
  650. CREATE TABLE `share_download_record` (
  651. `id` bigint(20) NOT NULL AUTO_INCREMENT,
  652. `uuid` varchar(50) DEFAULT NULL,
  653. `name` varchar(255) NOT NULL,
  654. `path` varchar(255) DEFAULT NULL,
  655. `status` smallint(1) NOT NULL,
  656. `create_time` datetime NOT NULL,
  657. `last_download_time` datetime DEFAULT NULL,
  658. PRIMARY KEY (`id`) USING BTREE
  659. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
  660. SET FOREIGN_KEY_CHECKS = 1;
  661. INSERT INTO `user` (`id`, `email`, `username`, `password`, `admin`, `active`, `name`, `description`, `department`, `avatar`, `create_time`, `create_by`, `update_by`, `update_time`)
  662. VALUES (1, 'guest@davinci.cn', 'guest', '$2a$10$RJKb4jhMgRYnGPlVRV036erxQ3oGZ8NnxZrlrrBJJha9376cAuTRO', 1, 1, NULL, NULL, NULL, NULL, '2020-01-01 00:00:00', 0, NULL, NULL);
  663. INSERT INTO `organization` (`id`, `name`, `description`, `avatar`, `user_id`, `project_num`, `member_num`, `role_num`, `allow_create_project`, `member_permission`, `create_time`, `create_by`, `update_time`, `update_by`)
  664. VALUES (1, 'guest\'s Organization', NULL, NULL, 1, 0, 1, 0, 1, 1, '2020-01-01 00:00:00', 1, NULL, NULL);
  665. INSERT INTO `rel_user_organization` (`id`, `org_id`, `user_id`, `role`, `create_by`, `create_time`, `update_by`, `update_time`)
  666. VALUES (1, 1, 1, 1, 1, '2020-01-01 00:00:00', NULL, NULL);