dolphinscheduler_postgre.sql 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one or more
  3. * contributor license agreements. See the NOTICE file distributed with
  4. * this work for additional information regarding copyright ownership.
  5. * The ASF licenses this file to You under the Apache License, Version 2.0
  6. * (the "License"); you may not use this file except in compliance with
  7. * the License. You may obtain a copy of the License at
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. */
  17. DROP TABLE IF EXISTS QRTZ_FIRED_TRIGGERS;
  18. DROP TABLE IF EXISTS QRTZ_PAUSED_TRIGGER_GRPS;
  19. DROP TABLE IF EXISTS QRTZ_SCHEDULER_STATE;
  20. DROP TABLE IF EXISTS QRTZ_LOCKS;
  21. DROP TABLE IF EXISTS QRTZ_SIMPLE_TRIGGERS;
  22. DROP TABLE IF EXISTS QRTZ_SIMPROP_TRIGGERS;
  23. DROP TABLE IF EXISTS QRTZ_CRON_TRIGGERS;
  24. DROP TABLE IF EXISTS QRTZ_BLOB_TRIGGERS;
  25. DROP TABLE IF EXISTS QRTZ_TRIGGERS;
  26. DROP TABLE IF EXISTS QRTZ_JOB_DETAILS;
  27. DROP TABLE IF EXISTS QRTZ_CALENDARS;
  28. CREATE TABLE QRTZ_JOB_DETAILS (
  29. SCHED_NAME character varying(120) NOT NULL,
  30. JOB_NAME character varying(200) NOT NULL,
  31. JOB_GROUP character varying(200) NOT NULL,
  32. DESCRIPTION character varying(250) NULL,
  33. JOB_CLASS_NAME character varying(250) NOT NULL,
  34. IS_DURABLE boolean NOT NULL,
  35. IS_NONCONCURRENT boolean NOT NULL,
  36. IS_UPDATE_DATA boolean NOT NULL,
  37. REQUESTS_RECOVERY boolean NOT NULL,
  38. JOB_DATA bytea NULL
  39. );
  40. alter table QRTZ_JOB_DETAILS add primary key(SCHED_NAME,JOB_NAME,JOB_GROUP);
  41. CREATE TABLE QRTZ_TRIGGERS (
  42. SCHED_NAME character varying(120) NOT NULL,
  43. TRIGGER_NAME character varying(200) NOT NULL,
  44. TRIGGER_GROUP character varying(200) NOT NULL,
  45. JOB_NAME character varying(200) NOT NULL,
  46. JOB_GROUP character varying(200) NOT NULL,
  47. DESCRIPTION character varying(250) NULL,
  48. NEXT_FIRE_TIME BIGINT NULL,
  49. PREV_FIRE_TIME BIGINT NULL,
  50. PRIORITY INTEGER NULL,
  51. TRIGGER_STATE character varying(16) NOT NULL,
  52. TRIGGER_TYPE character varying(8) NOT NULL,
  53. START_TIME BIGINT NOT NULL,
  54. END_TIME BIGINT NULL,
  55. CALENDAR_NAME character varying(200) NULL,
  56. MISFIRE_INSTR SMALLINT NULL,
  57. JOB_DATA bytea NULL
  58. ) ;
  59. alter table QRTZ_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  60. CREATE TABLE QRTZ_SIMPLE_TRIGGERS (
  61. SCHED_NAME character varying(120) NOT NULL,
  62. TRIGGER_NAME character varying(200) NOT NULL,
  63. TRIGGER_GROUP character varying(200) NOT NULL,
  64. REPEAT_COUNT BIGINT NOT NULL,
  65. REPEAT_INTERVAL BIGINT NOT NULL,
  66. TIMES_TRIGGERED BIGINT NOT NULL
  67. ) ;
  68. alter table QRTZ_SIMPLE_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  69. CREATE TABLE QRTZ_CRON_TRIGGERS (
  70. SCHED_NAME character varying(120) NOT NULL,
  71. TRIGGER_NAME character varying(200) NOT NULL,
  72. TRIGGER_GROUP character varying(200) NOT NULL,
  73. CRON_EXPRESSION character varying(120) NOT NULL,
  74. TIME_ZONE_ID character varying(80)
  75. ) ;
  76. alter table QRTZ_CRON_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  77. CREATE TABLE QRTZ_SIMPROP_TRIGGERS (
  78. SCHED_NAME character varying(120) NOT NULL,
  79. TRIGGER_NAME character varying(200) NOT NULL,
  80. TRIGGER_GROUP character varying(200) NOT NULL,
  81. STR_PROP_1 character varying(512) NULL,
  82. STR_PROP_2 character varying(512) NULL,
  83. STR_PROP_3 character varying(512) NULL,
  84. INT_PROP_1 INT NULL,
  85. INT_PROP_2 INT NULL,
  86. LONG_PROP_1 BIGINT NULL,
  87. LONG_PROP_2 BIGINT NULL,
  88. DEC_PROP_1 NUMERIC(13,4) NULL,
  89. DEC_PROP_2 NUMERIC(13,4) NULL,
  90. BOOL_PROP_1 boolean NULL,
  91. BOOL_PROP_2 boolean NULL
  92. ) ;
  93. alter table QRTZ_SIMPROP_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  94. CREATE TABLE QRTZ_BLOB_TRIGGERS (
  95. SCHED_NAME character varying(120) NOT NULL,
  96. TRIGGER_NAME character varying(200) NOT NULL,
  97. TRIGGER_GROUP character varying(200) NOT NULL,
  98. BLOB_DATA bytea NULL
  99. ) ;
  100. alter table QRTZ_BLOB_TRIGGERS add primary key(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  101. CREATE TABLE QRTZ_CALENDARS (
  102. SCHED_NAME character varying(120) NOT NULL,
  103. CALENDAR_NAME character varying(200) NOT NULL,
  104. CALENDAR bytea NOT NULL
  105. ) ;
  106. alter table QRTZ_CALENDARS add primary key(SCHED_NAME,CALENDAR_NAME);
  107. CREATE TABLE QRTZ_PAUSED_TRIGGER_GRPS (
  108. SCHED_NAME character varying(120) NOT NULL,
  109. TRIGGER_GROUP character varying(200) NOT NULL
  110. ) ;
  111. alter table QRTZ_PAUSED_TRIGGER_GRPS add primary key(SCHED_NAME,TRIGGER_GROUP);
  112. CREATE TABLE QRTZ_FIRED_TRIGGERS (
  113. SCHED_NAME character varying(120) NOT NULL,
  114. ENTRY_ID character varying(200) NOT NULL,
  115. TRIGGER_NAME character varying(200) NOT NULL,
  116. TRIGGER_GROUP character varying(200) NOT NULL,
  117. INSTANCE_NAME character varying(200) NOT NULL,
  118. FIRED_TIME BIGINT NOT NULL,
  119. SCHED_TIME BIGINT NOT NULL,
  120. PRIORITY INTEGER NOT NULL,
  121. STATE character varying(16) NOT NULL,
  122. JOB_NAME character varying(200) NULL,
  123. JOB_GROUP character varying(200) NULL,
  124. IS_NONCONCURRENT boolean NULL,
  125. REQUESTS_RECOVERY boolean NULL
  126. ) ;
  127. alter table QRTZ_FIRED_TRIGGERS add primary key(SCHED_NAME,ENTRY_ID);
  128. CREATE TABLE QRTZ_SCHEDULER_STATE (
  129. SCHED_NAME character varying(120) NOT NULL,
  130. INSTANCE_NAME character varying(200) NOT NULL,
  131. LAST_CHECKIN_TIME BIGINT NOT NULL,
  132. CHECKIN_INTERVAL BIGINT NOT NULL
  133. ) ;
  134. alter table QRTZ_SCHEDULER_STATE add primary key(SCHED_NAME,INSTANCE_NAME);
  135. CREATE TABLE QRTZ_LOCKS (
  136. SCHED_NAME character varying(120) NOT NULL,
  137. LOCK_NAME character varying(40) NOT NULL
  138. ) ;
  139. alter table QRTZ_LOCKS add primary key(SCHED_NAME,LOCK_NAME);
  140. CREATE INDEX IDX_QRTZ_J_REQ_RECOVERY ON QRTZ_JOB_DETAILS(SCHED_NAME,REQUESTS_RECOVERY);
  141. CREATE INDEX IDX_QRTZ_J_GRP ON QRTZ_JOB_DETAILS(SCHED_NAME,JOB_GROUP);
  142. CREATE INDEX IDX_QRTZ_T_J ON QRTZ_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  143. CREATE INDEX IDX_QRTZ_T_JG ON QRTZ_TRIGGERS(SCHED_NAME,JOB_GROUP);
  144. CREATE INDEX IDX_QRTZ_T_C ON QRTZ_TRIGGERS(SCHED_NAME,CALENDAR_NAME);
  145. CREATE INDEX IDX_QRTZ_T_G ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  146. CREATE INDEX IDX_QRTZ_T_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE);
  147. CREATE INDEX IDX_QRTZ_T_N_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  148. CREATE INDEX IDX_QRTZ_T_N_G_STATE ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_GROUP,TRIGGER_STATE);
  149. CREATE INDEX IDX_QRTZ_T_NEXT_FIRE_TIME ON QRTZ_TRIGGERS(SCHED_NAME,NEXT_FIRE_TIME);
  150. CREATE INDEX IDX_QRTZ_T_NFT_ST ON QRTZ_TRIGGERS(SCHED_NAME,TRIGGER_STATE,NEXT_FIRE_TIME);
  151. CREATE INDEX IDX_QRTZ_T_NFT_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME);
  152. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_STATE);
  153. CREATE INDEX IDX_QRTZ_T_NFT_ST_MISFIRE_GRP ON QRTZ_TRIGGERS(SCHED_NAME,MISFIRE_INSTR,NEXT_FIRE_TIME,TRIGGER_GROUP,TRIGGER_STATE);
  154. CREATE INDEX IDX_QRTZ_FT_TRIG_INST_NAME ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME);
  155. CREATE INDEX IDX_QRTZ_FT_INST_JOB_REQ_RCVRY ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,INSTANCE_NAME,REQUESTS_RECOVERY);
  156. CREATE INDEX IDX_QRTZ_FT_J_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_NAME,JOB_GROUP);
  157. CREATE INDEX IDX_QRTZ_FT_JG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,JOB_GROUP);
  158. CREATE INDEX IDX_QRTZ_FT_T_G ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_NAME,TRIGGER_GROUP);
  159. CREATE INDEX IDX_QRTZ_FT_TG ON QRTZ_FIRED_TRIGGERS(SCHED_NAME,TRIGGER_GROUP);
  160. --
  161. -- Table structure for table t_ds_access_token
  162. --
  163. DROP TABLE IF EXISTS t_ds_access_token;
  164. CREATE TABLE t_ds_access_token (
  165. id int NOT NULL ,
  166. user_id int DEFAULT NULL ,
  167. token varchar(64) DEFAULT NULL ,
  168. expire_time timestamp DEFAULT NULL ,
  169. create_time timestamp DEFAULT NULL ,
  170. update_time timestamp DEFAULT NULL ,
  171. PRIMARY KEY (id)
  172. ) ;
  173. --
  174. -- Table structure for table t_ds_alert
  175. --
  176. DROP TABLE IF EXISTS t_ds_alert;
  177. CREATE TABLE t_ds_alert (
  178. id int NOT NULL ,
  179. title varchar(64) DEFAULT NULL ,
  180. content text ,
  181. alert_status int DEFAULT '0' ,
  182. log text ,
  183. alertgroup_id int DEFAULT NULL ,
  184. create_time timestamp DEFAULT NULL ,
  185. update_time timestamp DEFAULT NULL ,
  186. PRIMARY KEY (id)
  187. ) ;
  188. --
  189. -- Table structure for table t_ds_alertgroup
  190. --
  191. DROP TABLE IF EXISTS t_ds_alertgroup;
  192. CREATE TABLE t_ds_alertgroup(
  193. id int NOT NULL,
  194. alert_instance_ids varchar (255) DEFAULT NULL,
  195. create_user_id int4 DEFAULT NULL,
  196. group_name varchar(255) DEFAULT NULL,
  197. description varchar(255) DEFAULT NULL,
  198. create_time timestamp DEFAULT NULL,
  199. update_time timestamp DEFAULT NULL,
  200. PRIMARY KEY (id),
  201. CONSTRAINT t_ds_alertgroup_name_un UNIQUE (group_name)
  202. ) ;
  203. --
  204. -- Table structure for table t_ds_command
  205. --
  206. DROP TABLE IF EXISTS t_ds_command;
  207. CREATE TABLE t_ds_command (
  208. id int NOT NULL ,
  209. command_type int DEFAULT NULL ,
  210. process_definition_code bigint NOT NULL ,
  211. command_param text ,
  212. task_depend_type int DEFAULT NULL ,
  213. failure_strategy int DEFAULT '0' ,
  214. warning_type int DEFAULT '0' ,
  215. warning_group_id int DEFAULT NULL ,
  216. schedule_time timestamp DEFAULT NULL ,
  217. start_time timestamp DEFAULT NULL ,
  218. executor_id int DEFAULT NULL ,
  219. update_time timestamp DEFAULT NULL ,
  220. process_instance_priority int DEFAULT NULL ,
  221. worker_group varchar(64),
  222. environment_code bigint DEFAULT '-1',
  223. PRIMARY KEY (id)
  224. ) ;
  225. --
  226. -- Table structure for table t_ds_datasource
  227. --
  228. DROP TABLE IF EXISTS t_ds_datasource;
  229. CREATE TABLE t_ds_datasource (
  230. id int NOT NULL ,
  231. name varchar(64) NOT NULL ,
  232. note varchar(255) DEFAULT NULL ,
  233. type int NOT NULL ,
  234. user_id int NOT NULL ,
  235. connection_params text NOT NULL ,
  236. create_time timestamp NOT NULL ,
  237. update_time timestamp DEFAULT NULL ,
  238. PRIMARY KEY (id),
  239. CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type)
  240. ) ;
  241. --
  242. -- Table structure for table t_ds_error_command
  243. --
  244. DROP TABLE IF EXISTS t_ds_error_command;
  245. CREATE TABLE t_ds_error_command (
  246. id int NOT NULL ,
  247. command_type int DEFAULT NULL ,
  248. executor_id int DEFAULT NULL ,
  249. process_definition_code bigint NOT NULL ,
  250. command_param text ,
  251. task_depend_type int DEFAULT NULL ,
  252. failure_strategy int DEFAULT '0' ,
  253. warning_type int DEFAULT '0' ,
  254. warning_group_id int DEFAULT NULL ,
  255. schedule_time timestamp DEFAULT NULL ,
  256. start_time timestamp DEFAULT NULL ,
  257. update_time timestamp DEFAULT NULL ,
  258. process_instance_priority int DEFAULT NULL ,
  259. worker_group varchar(64),
  260. environment_code bigint DEFAULT '-1',
  261. message text ,
  262. PRIMARY KEY (id)
  263. );
  264. --
  265. -- Table structure for table t_ds_master_server
  266. --
  267. --
  268. -- Table structure for table t_ds_process_definition
  269. --
  270. DROP TABLE IF EXISTS t_ds_process_definition;
  271. CREATE TABLE t_ds_process_definition (
  272. id int NOT NULL ,
  273. code bigint NOT NULL,
  274. name varchar(255) DEFAULT NULL ,
  275. version int DEFAULT NULL ,
  276. description text ,
  277. project_code bigint DEFAULT NULL ,
  278. release_state int DEFAULT NULL ,
  279. user_id int DEFAULT NULL ,
  280. global_params text ,
  281. locations text ,
  282. warning_group_id int DEFAULT NULL ,
  283. flag int DEFAULT NULL ,
  284. timeout int DEFAULT '0' ,
  285. tenant_id int DEFAULT '-1' ,
  286. create_time timestamp DEFAULT NULL ,
  287. update_time timestamp DEFAULT NULL ,
  288. PRIMARY KEY (id) ,
  289. CONSTRAINT process_definition_unique UNIQUE (name, project_code)
  290. ) ;
  291. create index process_definition_index on t_ds_process_definition (code,id);
  292. DROP TABLE IF EXISTS t_ds_process_definition_log;
  293. CREATE TABLE t_ds_process_definition_log (
  294. id int NOT NULL ,
  295. code bigint NOT NULL,
  296. name varchar(255) DEFAULT NULL ,
  297. version int DEFAULT NULL ,
  298. description text ,
  299. project_code bigint DEFAULT NULL ,
  300. release_state int DEFAULT NULL ,
  301. user_id int DEFAULT NULL ,
  302. global_params text ,
  303. locations text ,
  304. warning_group_id int DEFAULT NULL ,
  305. flag int DEFAULT NULL ,
  306. timeout int DEFAULT '0' ,
  307. tenant_id int DEFAULT '-1' ,
  308. operator int DEFAULT NULL ,
  309. operate_time timestamp DEFAULT NULL ,
  310. create_time timestamp DEFAULT NULL ,
  311. update_time timestamp DEFAULT NULL ,
  312. PRIMARY KEY (id)
  313. ) ;
  314. DROP TABLE IF EXISTS t_ds_task_definition;
  315. CREATE TABLE t_ds_task_definition (
  316. id int NOT NULL ,
  317. code bigint NOT NULL,
  318. name varchar(255) DEFAULT NULL ,
  319. version int DEFAULT NULL ,
  320. description text ,
  321. project_code bigint DEFAULT NULL ,
  322. user_id int DEFAULT NULL ,
  323. task_type varchar(50) DEFAULT NULL ,
  324. task_params text ,
  325. flag int DEFAULT NULL ,
  326. task_priority int DEFAULT NULL ,
  327. worker_group varchar(255) DEFAULT NULL ,
  328. environment_code bigint DEFAULT '-1',
  329. fail_retry_times int DEFAULT NULL ,
  330. fail_retry_interval int DEFAULT NULL ,
  331. timeout_flag int DEFAULT NULL ,
  332. timeout_notify_strategy int DEFAULT NULL ,
  333. timeout int DEFAULT '0' ,
  334. delay_time int DEFAULT '0' ,
  335. resource_ids varchar(255) DEFAULT NULL ,
  336. create_time timestamp DEFAULT NULL ,
  337. update_time timestamp DEFAULT NULL ,
  338. PRIMARY KEY (id) ,
  339. CONSTRAINT task_definition_unique UNIQUE (name, project_code)
  340. ) ;
  341. create index task_definition_index on t_ds_task_definition (project_code,id);
  342. DROP TABLE IF EXISTS t_ds_task_definition_log;
  343. CREATE TABLE t_ds_task_definition_log (
  344. id int NOT NULL ,
  345. code bigint NOT NULL,
  346. name varchar(255) DEFAULT NULL ,
  347. version int DEFAULT NULL ,
  348. description text ,
  349. project_code bigint DEFAULT NULL ,
  350. user_id int DEFAULT NULL ,
  351. task_type varchar(50) DEFAULT NULL ,
  352. task_params text ,
  353. flag int DEFAULT NULL ,
  354. task_priority int DEFAULT NULL ,
  355. worker_group varchar(255) DEFAULT NULL ,
  356. environment_code bigint DEFAULT '-1',
  357. fail_retry_times int DEFAULT NULL ,
  358. fail_retry_interval int DEFAULT NULL ,
  359. timeout_flag int DEFAULT NULL ,
  360. timeout_notify_strategy int DEFAULT NULL ,
  361. timeout int DEFAULT '0' ,
  362. delay_time int DEFAULT '0' ,
  363. resource_ids varchar(255) DEFAULT NULL ,
  364. operator int DEFAULT NULL ,
  365. operate_time timestamp DEFAULT NULL ,
  366. create_time timestamp DEFAULT NULL ,
  367. update_time timestamp DEFAULT NULL ,
  368. PRIMARY KEY (id)
  369. ) ;
  370. DROP TABLE IF EXISTS t_ds_process_task_relation;
  371. CREATE TABLE t_ds_process_task_relation (
  372. id int NOT NULL ,
  373. name varchar(255) DEFAULT NULL ,
  374. process_definition_version int DEFAULT NULL ,
  375. project_code bigint DEFAULT NULL ,
  376. process_definition_code bigint DEFAULT NULL ,
  377. pre_task_code bigint DEFAULT NULL ,
  378. pre_task_version int DEFAULT '0' ,
  379. post_task_code bigint DEFAULT NULL ,
  380. post_task_version int DEFAULT '0' ,
  381. condition_type int DEFAULT NULL ,
  382. condition_params text ,
  383. create_time timestamp DEFAULT NULL ,
  384. update_time timestamp DEFAULT NULL ,
  385. PRIMARY KEY (id)
  386. ) ;
  387. DROP TABLE IF EXISTS t_ds_process_task_relation_log;
  388. CREATE TABLE t_ds_process_task_relation_log (
  389. id int NOT NULL ,
  390. name varchar(255) DEFAULT NULL ,
  391. process_definition_version int DEFAULT NULL ,
  392. project_code bigint DEFAULT NULL ,
  393. process_definition_code bigint DEFAULT NULL ,
  394. pre_task_code bigint DEFAULT NULL ,
  395. pre_task_version int DEFAULT '0' ,
  396. post_task_code bigint DEFAULT NULL ,
  397. post_task_version int DEFAULT '0' ,
  398. condition_type int DEFAULT NULL ,
  399. condition_params text ,
  400. operator int DEFAULT NULL ,
  401. operate_time timestamp DEFAULT NULL ,
  402. create_time timestamp DEFAULT NULL ,
  403. update_time timestamp DEFAULT NULL ,
  404. PRIMARY KEY (id)
  405. ) ;
  406. --
  407. -- Table structure for table t_ds_process_instance
  408. --
  409. DROP TABLE IF EXISTS t_ds_process_instance;
  410. CREATE TABLE t_ds_process_instance (
  411. id int NOT NULL ,
  412. name varchar(255) DEFAULT NULL ,
  413. process_definition_version int DEFAULT NULL ,
  414. process_definition_code bigint DEFAULT NULL ,
  415. state int DEFAULT NULL ,
  416. recovery int DEFAULT NULL ,
  417. start_time timestamp DEFAULT NULL ,
  418. end_time timestamp DEFAULT NULL ,
  419. run_times int DEFAULT NULL ,
  420. host varchar(135) DEFAULT NULL ,
  421. command_type int DEFAULT NULL ,
  422. command_param text ,
  423. task_depend_type int DEFAULT NULL ,
  424. max_try_times int DEFAULT '0' ,
  425. failure_strategy int DEFAULT '0' ,
  426. warning_type int DEFAULT '0' ,
  427. warning_group_id int DEFAULT NULL ,
  428. schedule_time timestamp DEFAULT NULL ,
  429. command_start_time timestamp DEFAULT NULL ,
  430. global_params text ,
  431. process_instance_json text ,
  432. flag int DEFAULT '1' ,
  433. update_time timestamp NULL ,
  434. is_sub_process int DEFAULT '0' ,
  435. executor_id int NOT NULL ,
  436. history_cmd text ,
  437. dependence_schedule_times text ,
  438. process_instance_priority int DEFAULT NULL ,
  439. worker_group varchar(64) ,
  440. environment_code bigint DEFAULT '-1',
  441. timeout int DEFAULT '0' ,
  442. tenant_id int NOT NULL DEFAULT '-1' ,
  443. var_pool text ,
  444. PRIMARY KEY (id)
  445. ) ;
  446. create index process_instance_index on t_ds_process_instance (process_definition_code,id);
  447. create index start_time_index on t_ds_process_instance (start_time);
  448. --
  449. -- Table structure for table t_ds_project
  450. --
  451. DROP TABLE IF EXISTS t_ds_project;
  452. CREATE TABLE t_ds_project (
  453. id int NOT NULL ,
  454. name varchar(100) DEFAULT NULL ,
  455. code bigint NOT NULL,
  456. description varchar(200) DEFAULT NULL ,
  457. user_id int DEFAULT NULL ,
  458. flag int DEFAULT '1' ,
  459. create_time timestamp DEFAULT CURRENT_TIMESTAMP ,
  460. update_time timestamp DEFAULT CURRENT_TIMESTAMP ,
  461. PRIMARY KEY (id)
  462. ) ;
  463. create index user_id_index on t_ds_project (user_id);
  464. --
  465. -- Table structure for table t_ds_queue
  466. --
  467. DROP TABLE IF EXISTS t_ds_queue;
  468. CREATE TABLE t_ds_queue (
  469. id int NOT NULL ,
  470. queue_name varchar(64) DEFAULT NULL ,
  471. queue varchar(64) DEFAULT NULL ,
  472. create_time timestamp DEFAULT NULL ,
  473. update_time timestamp DEFAULT NULL ,
  474. PRIMARY KEY (id)
  475. );
  476. --
  477. -- Table structure for table t_ds_relation_datasource_user
  478. --
  479. DROP TABLE IF EXISTS t_ds_relation_datasource_user;
  480. CREATE TABLE t_ds_relation_datasource_user (
  481. id int NOT NULL ,
  482. user_id int NOT NULL ,
  483. datasource_id int DEFAULT NULL ,
  484. perm int DEFAULT '1' ,
  485. create_time timestamp DEFAULT NULL ,
  486. update_time timestamp DEFAULT NULL ,
  487. PRIMARY KEY (id)
  488. ) ;
  489. ;
  490. --
  491. -- Table structure for table t_ds_relation_process_instance
  492. --
  493. DROP TABLE IF EXISTS t_ds_relation_process_instance;
  494. CREATE TABLE t_ds_relation_process_instance (
  495. id int NOT NULL ,
  496. parent_process_instance_id int DEFAULT NULL ,
  497. parent_task_instance_id int DEFAULT NULL ,
  498. process_instance_id int DEFAULT NULL ,
  499. PRIMARY KEY (id)
  500. ) ;
  501. --
  502. -- Table structure for table t_ds_relation_project_user
  503. --
  504. DROP TABLE IF EXISTS t_ds_relation_project_user;
  505. CREATE TABLE t_ds_relation_project_user (
  506. id int NOT NULL ,
  507. user_id int NOT NULL ,
  508. project_id int DEFAULT NULL ,
  509. perm int DEFAULT '1' ,
  510. create_time timestamp DEFAULT NULL ,
  511. update_time timestamp DEFAULT NULL ,
  512. PRIMARY KEY (id)
  513. ) ;
  514. create index relation_project_user_id_index on t_ds_relation_project_user (user_id);
  515. --
  516. -- Table structure for table t_ds_relation_resources_user
  517. --
  518. DROP TABLE IF EXISTS t_ds_relation_resources_user;
  519. CREATE TABLE t_ds_relation_resources_user (
  520. id int NOT NULL ,
  521. user_id int NOT NULL ,
  522. resources_id int DEFAULT NULL ,
  523. perm int DEFAULT '1' ,
  524. create_time timestamp DEFAULT NULL ,
  525. update_time timestamp DEFAULT NULL ,
  526. PRIMARY KEY (id)
  527. ) ;
  528. --
  529. -- Table structure for table t_ds_relation_udfs_user
  530. --
  531. DROP TABLE IF EXISTS t_ds_relation_udfs_user;
  532. CREATE TABLE t_ds_relation_udfs_user (
  533. id int NOT NULL ,
  534. user_id int NOT NULL ,
  535. udf_id int DEFAULT NULL ,
  536. perm int DEFAULT '1' ,
  537. create_time timestamp DEFAULT NULL ,
  538. update_time timestamp DEFAULT NULL ,
  539. PRIMARY KEY (id)
  540. ) ;
  541. ;
  542. --
  543. -- Table structure for table t_ds_resources
  544. --
  545. DROP TABLE IF EXISTS t_ds_resources;
  546. CREATE TABLE t_ds_resources (
  547. id int NOT NULL ,
  548. alias varchar(64) DEFAULT NULL ,
  549. file_name varchar(64) DEFAULT NULL ,
  550. description varchar(255) DEFAULT NULL ,
  551. user_id int DEFAULT NULL ,
  552. type int DEFAULT NULL ,
  553. size bigint DEFAULT NULL ,
  554. create_time timestamp DEFAULT NULL ,
  555. update_time timestamp DEFAULT NULL ,
  556. pid int,
  557. full_name varchar(64),
  558. is_directory int,
  559. PRIMARY KEY (id),
  560. CONSTRAINT t_ds_resources_un UNIQUE (full_name, type)
  561. ) ;
  562. --
  563. -- Table structure for table t_ds_schedules
  564. --
  565. DROP TABLE IF EXISTS t_ds_schedules;
  566. CREATE TABLE t_ds_schedules (
  567. id int NOT NULL ,
  568. process_definition_code bigint NOT NULL ,
  569. start_time timestamp NOT NULL ,
  570. end_time timestamp NOT NULL ,
  571. timezone_id varchar(40) default NULL ,
  572. crontab varchar(255) NOT NULL ,
  573. failure_strategy int NOT NULL ,
  574. user_id int NOT NULL ,
  575. release_state int NOT NULL ,
  576. warning_type int NOT NULL ,
  577. warning_group_id int DEFAULT NULL ,
  578. process_instance_priority int DEFAULT NULL ,
  579. worker_group varchar(64),
  580. environment_code bigint DEFAULT '-1',
  581. create_time timestamp NOT NULL ,
  582. update_time timestamp NOT NULL ,
  583. PRIMARY KEY (id)
  584. );
  585. --
  586. -- Table structure for table t_ds_session
  587. --
  588. DROP TABLE IF EXISTS t_ds_session;
  589. CREATE TABLE t_ds_session (
  590. id varchar(64) NOT NULL ,
  591. user_id int DEFAULT NULL ,
  592. ip varchar(45) DEFAULT NULL ,
  593. last_login_time timestamp DEFAULT NULL ,
  594. PRIMARY KEY (id)
  595. );
  596. --
  597. -- Table structure for table t_ds_task_instance
  598. --
  599. DROP TABLE IF EXISTS t_ds_task_instance;
  600. CREATE TABLE t_ds_task_instance (
  601. id int NOT NULL ,
  602. name varchar(255) DEFAULT NULL ,
  603. task_type varchar(50) DEFAULT NULL ,
  604. task_code bigint NOT NULL,
  605. task_definition_version int DEFAULT NULL ,
  606. process_instance_id int DEFAULT NULL ,
  607. state int DEFAULT NULL ,
  608. submit_time timestamp DEFAULT NULL ,
  609. start_time timestamp DEFAULT NULL ,
  610. end_time timestamp DEFAULT NULL ,
  611. host varchar(135) DEFAULT NULL ,
  612. execute_path varchar(200) DEFAULT NULL ,
  613. log_path varchar(200) DEFAULT NULL ,
  614. alert_flag int DEFAULT NULL ,
  615. retry_times int DEFAULT '0' ,
  616. pid int DEFAULT NULL ,
  617. app_link text ,
  618. task_params text ,
  619. flag int DEFAULT '1' ,
  620. retry_interval int DEFAULT NULL ,
  621. max_retry_times int DEFAULT NULL ,
  622. task_instance_priority int DEFAULT NULL ,
  623. worker_group varchar(64),
  624. environment_code bigint DEFAULT '-1',
  625. environment_config text,
  626. executor_id int DEFAULT NULL ,
  627. first_submit_time timestamp DEFAULT NULL ,
  628. delay_time int DEFAULT '0' ,
  629. var_pool text ,
  630. PRIMARY KEY (id),
  631. CONSTRAINT foreign_key_instance_id FOREIGN KEY(process_instance_id) REFERENCES t_ds_process_instance(id) ON DELETE CASCADE
  632. ) ;
  633. --
  634. -- Table structure for table t_ds_tenant
  635. --
  636. DROP TABLE IF EXISTS t_ds_tenant;
  637. CREATE TABLE t_ds_tenant (
  638. id int NOT NULL ,
  639. tenant_code varchar(64) DEFAULT NULL ,
  640. description varchar(255) DEFAULT NULL ,
  641. queue_id int DEFAULT NULL ,
  642. create_time timestamp DEFAULT NULL ,
  643. update_time timestamp DEFAULT NULL ,
  644. PRIMARY KEY (id)
  645. ) ;
  646. --
  647. -- Table structure for table t_ds_udfs
  648. --
  649. DROP TABLE IF EXISTS t_ds_udfs;
  650. CREATE TABLE t_ds_udfs (
  651. id int NOT NULL ,
  652. user_id int NOT NULL ,
  653. func_name varchar(100) NOT NULL ,
  654. class_name varchar(255) NOT NULL ,
  655. type int NOT NULL ,
  656. arg_types varchar(255) DEFAULT NULL ,
  657. database varchar(255) DEFAULT NULL ,
  658. description varchar(255) DEFAULT NULL ,
  659. resource_id int NOT NULL ,
  660. resource_name varchar(255) NOT NULL ,
  661. create_time timestamp NOT NULL ,
  662. update_time timestamp NOT NULL ,
  663. PRIMARY KEY (id)
  664. ) ;
  665. --
  666. -- Table structure for table t_ds_user
  667. --
  668. DROP TABLE IF EXISTS t_ds_user;
  669. CREATE TABLE t_ds_user (
  670. id int NOT NULL ,
  671. user_name varchar(64) DEFAULT NULL ,
  672. user_password varchar(64) DEFAULT NULL ,
  673. user_type int DEFAULT NULL ,
  674. email varchar(64) DEFAULT NULL ,
  675. phone varchar(11) DEFAULT NULL ,
  676. tenant_id int DEFAULT NULL ,
  677. create_time timestamp DEFAULT NULL ,
  678. update_time timestamp DEFAULT NULL ,
  679. queue varchar(64) DEFAULT NULL ,
  680. state int DEFAULT 1 ,
  681. PRIMARY KEY (id)
  682. );
  683. comment on column t_ds_user.state is 'state 0:disable 1:enable';
  684. --
  685. -- Table structure for table t_ds_version
  686. --
  687. DROP TABLE IF EXISTS t_ds_version;
  688. CREATE TABLE t_ds_version (
  689. id int NOT NULL ,
  690. version varchar(200) NOT NULL,
  691. PRIMARY KEY (id)
  692. ) ;
  693. create index version_index on t_ds_version(version);
  694. --
  695. -- Table structure for table t_ds_worker_group
  696. --
  697. DROP TABLE IF EXISTS t_ds_worker_group;
  698. CREATE TABLE t_ds_worker_group (
  699. id bigint NOT NULL ,
  700. name varchar(255) NOT NULL ,
  701. addr_list text DEFAULT NULL ,
  702. create_time timestamp DEFAULT NULL ,
  703. update_time timestamp DEFAULT NULL ,
  704. PRIMARY KEY (id) ,
  705. CONSTRAINT name_unique UNIQUE (name)
  706. ) ;
  707. --
  708. -- Table structure for table t_ds_worker_server
  709. --
  710. DROP TABLE IF EXISTS t_ds_worker_server;
  711. CREATE TABLE t_ds_worker_server (
  712. id int NOT NULL ,
  713. host varchar(45) DEFAULT NULL ,
  714. port int DEFAULT NULL ,
  715. zk_directory varchar(64) DEFAULT NULL ,
  716. res_info varchar(255) DEFAULT NULL ,
  717. create_time timestamp DEFAULT NULL ,
  718. last_heartbeat_time timestamp DEFAULT NULL ,
  719. PRIMARY KEY (id)
  720. ) ;
  721. DROP SEQUENCE IF EXISTS t_ds_access_token_id_sequence;
  722. CREATE SEQUENCE t_ds_access_token_id_sequence;
  723. ALTER TABLE t_ds_access_token ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_access_token_id_sequence');
  724. DROP SEQUENCE IF EXISTS t_ds_alert_id_sequence;
  725. CREATE SEQUENCE t_ds_alert_id_sequence;
  726. ALTER TABLE t_ds_alert ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_alert_id_sequence');
  727. DROP SEQUENCE IF EXISTS t_ds_alertgroup_id_sequence;
  728. CREATE SEQUENCE t_ds_alertgroup_id_sequence;
  729. ALTER TABLE t_ds_alertgroup ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_alertgroup_id_sequence');
  730. DROP SEQUENCE IF EXISTS t_ds_command_id_sequence;
  731. CREATE SEQUENCE t_ds_command_id_sequence;
  732. ALTER TABLE t_ds_command ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_command_id_sequence');
  733. DROP SEQUENCE IF EXISTS t_ds_datasource_id_sequence;
  734. CREATE SEQUENCE t_ds_datasource_id_sequence;
  735. ALTER TABLE t_ds_datasource ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_datasource_id_sequence');
  736. DROP SEQUENCE IF EXISTS t_ds_process_definition_id_sequence;
  737. CREATE SEQUENCE t_ds_process_definition_id_sequence;
  738. ALTER TABLE t_ds_process_definition ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_definition_id_sequence');
  739. DROP SEQUENCE IF EXISTS t_ds_process_definition_log_id_sequence;
  740. CREATE SEQUENCE t_ds_process_definition_log_id_sequence;
  741. ALTER TABLE t_ds_process_definition_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_definition_log_id_sequence');
  742. DROP SEQUENCE IF EXISTS t_ds_task_definition_id_sequence;
  743. CREATE SEQUENCE t_ds_task_definition_id_sequence;
  744. ALTER TABLE t_ds_task_definition ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_definition_id_sequence');
  745. DROP SEQUENCE IF EXISTS t_ds_task_definition_log_id_sequence;
  746. CREATE SEQUENCE t_ds_task_definition_log_id_sequence;
  747. ALTER TABLE t_ds_task_definition_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_definition_log_id_sequence');
  748. DROP SEQUENCE IF EXISTS t_ds_process_task_relation_id_sequence;
  749. CREATE SEQUENCE t_ds_process_task_relation_id_sequence;
  750. ALTER TABLE t_ds_process_task_relation ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_task_relation_id_sequence');
  751. DROP SEQUENCE IF EXISTS t_ds_process_task_relation_log_id_sequence;
  752. CREATE SEQUENCE t_ds_process_task_relation_log_id_sequence;
  753. ALTER TABLE t_ds_process_task_relation_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_task_relation_log_id_sequence');
  754. DROP SEQUENCE IF EXISTS t_ds_process_instance_id_sequence;
  755. CREATE SEQUENCE t_ds_process_instance_id_sequence;
  756. ALTER TABLE t_ds_process_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_instance_id_sequence');
  757. DROP SEQUENCE IF EXISTS t_ds_project_id_sequence;
  758. CREATE SEQUENCE t_ds_project_id_sequence;
  759. ALTER TABLE t_ds_project ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_project_id_sequence');
  760. DROP SEQUENCE IF EXISTS t_ds_queue_id_sequence;
  761. CREATE SEQUENCE t_ds_queue_id_sequence;
  762. ALTER TABLE t_ds_queue ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_queue_id_sequence');
  763. DROP SEQUENCE IF EXISTS t_ds_relation_datasource_user_id_sequence;
  764. CREATE SEQUENCE t_ds_relation_datasource_user_id_sequence;
  765. ALTER TABLE t_ds_relation_datasource_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_datasource_user_id_sequence');
  766. DROP SEQUENCE IF EXISTS t_ds_relation_process_instance_id_sequence;
  767. CREATE SEQUENCE t_ds_relation_process_instance_id_sequence;
  768. ALTER TABLE t_ds_relation_process_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_process_instance_id_sequence');
  769. DROP SEQUENCE IF EXISTS t_ds_relation_project_user_id_sequence;
  770. CREATE SEQUENCE t_ds_relation_project_user_id_sequence;
  771. ALTER TABLE t_ds_relation_project_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_project_user_id_sequence');
  772. DROP SEQUENCE IF EXISTS t_ds_relation_resources_user_id_sequence;
  773. CREATE SEQUENCE t_ds_relation_resources_user_id_sequence;
  774. ALTER TABLE t_ds_relation_resources_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_resources_user_id_sequence');
  775. DROP SEQUENCE IF EXISTS t_ds_relation_udfs_user_id_sequence;
  776. CREATE SEQUENCE t_ds_relation_udfs_user_id_sequence;
  777. ALTER TABLE t_ds_relation_udfs_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_udfs_user_id_sequence');
  778. DROP SEQUENCE IF EXISTS t_ds_resources_id_sequence;
  779. CREATE SEQUENCE t_ds_resources_id_sequence;
  780. ALTER TABLE t_ds_resources ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_resources_id_sequence');
  781. DROP SEQUENCE IF EXISTS t_ds_schedules_id_sequence;
  782. CREATE SEQUENCE t_ds_schedules_id_sequence;
  783. ALTER TABLE t_ds_schedules ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_schedules_id_sequence');
  784. DROP SEQUENCE IF EXISTS t_ds_task_instance_id_sequence;
  785. CREATE SEQUENCE t_ds_task_instance_id_sequence;
  786. ALTER TABLE t_ds_task_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_instance_id_sequence');
  787. DROP SEQUENCE IF EXISTS t_ds_tenant_id_sequence;
  788. CREATE SEQUENCE t_ds_tenant_id_sequence;
  789. ALTER TABLE t_ds_tenant ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_tenant_id_sequence');
  790. DROP SEQUENCE IF EXISTS t_ds_udfs_id_sequence;
  791. CREATE SEQUENCE t_ds_udfs_id_sequence;
  792. ALTER TABLE t_ds_udfs ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_udfs_id_sequence');
  793. DROP SEQUENCE IF EXISTS t_ds_user_id_sequence;
  794. CREATE SEQUENCE t_ds_user_id_sequence;
  795. ALTER TABLE t_ds_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_user_id_sequence');
  796. DROP SEQUENCE IF EXISTS t_ds_version_id_sequence;
  797. CREATE SEQUENCE t_ds_version_id_sequence;
  798. ALTER TABLE t_ds_version ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_version_id_sequence');
  799. DROP SEQUENCE IF EXISTS t_ds_worker_group_id_sequence;
  800. CREATE SEQUENCE t_ds_worker_group_id_sequence;
  801. ALTER TABLE t_ds_worker_group ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_group_id_sequence');
  802. DROP SEQUENCE IF EXISTS t_ds_worker_server_id_sequence;
  803. CREATE SEQUENCE t_ds_worker_server_id_sequence;
  804. ALTER TABLE t_ds_worker_server ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_server_id_sequence');
  805. -- Records of t_ds_user?user : admin , password : dolphinscheduler123
  806. INSERT INTO t_ds_user(user_name, user_password, user_type, email, phone, tenant_id, state, create_time, update_time)
  807. VALUES ('admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', 1, '2018-03-27 15:48:50', '2018-10-24 17:40:22');
  808. -- Records of t_ds_alertgroup, default admin warning group
  809. INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  810. VALUES ('1,2', 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39', '2018-11-29 10:20:39');
  811. -- Records of t_ds_queue,default queue name : default
  812. INSERT INTO t_ds_queue(queue_name, queue, create_time, update_time)
  813. VALUES ('default', 'default', '2018-11-29 10:22:33', '2018-11-29 10:22:33');
  814. -- Records of t_ds_queue,default queue name : default
  815. INSERT INTO t_ds_version(version) VALUES ('1.4.0');
  816. --
  817. -- Table structure for table t_ds_plugin_define
  818. --
  819. DROP TABLE IF EXISTS t_ds_plugin_define;
  820. CREATE TABLE t_ds_plugin_define (
  821. id serial NOT NULL,
  822. plugin_name varchar(100) NOT NULL,
  823. plugin_type varchar(100) NOT NULL,
  824. plugin_params text NULL,
  825. create_time timestamp NULL,
  826. update_time timestamp NULL,
  827. CONSTRAINT t_ds_plugin_define_pk PRIMARY KEY (id),
  828. CONSTRAINT t_ds_plugin_define_un UNIQUE (plugin_name, plugin_type)
  829. );
  830. --
  831. -- Table structure for table t_ds_alert_plugin_instance
  832. --
  833. DROP TABLE IF EXISTS t_ds_alert_plugin_instance;
  834. CREATE TABLE t_ds_alert_plugin_instance (
  835. id serial NOT NULL,
  836. plugin_define_id int4 NOT NULL,
  837. plugin_instance_params text NULL,
  838. create_time timestamp NULL,
  839. update_time timestamp NULL,
  840. instance_name varchar(200) NULL,
  841. CONSTRAINT t_ds_alert_plugin_instance_pk PRIMARY KEY (id)
  842. );
  843. --
  844. -- Table structure for table t_ds_environment
  845. --
  846. DROP TABLE IF EXISTS t_ds_environment;
  847. CREATE TABLE t_ds_environment (
  848. id serial NOT NULL,
  849. code bigint NOT NULL,
  850. name varchar(100) DEFAULT NULL,
  851. config text DEFAULT NULL,
  852. description text,
  853. operator int DEFAULT NULL,
  854. create_time timestamp DEFAULT NULL,
  855. update_time timestamp DEFAULT NULL,
  856. PRIMARY KEY (id),
  857. CONSTRAINT environment_name_unique UNIQUE (name),
  858. CONSTRAINT environment_code_unique UNIQUE (code)
  859. );
  860. --
  861. -- Table structure for table t_ds_environment_worker_group_relation
  862. --
  863. DROP TABLE IF EXISTS t_ds_environment_worker_group_relation;
  864. CREATE TABLE t_ds_environment_worker_group_relation (
  865. id serial NOT NULL,
  866. environment_code bigint NOT NULL,
  867. worker_group varchar(255) NOT NULL,
  868. operator int DEFAULT NULL,
  869. create_time timestamp DEFAULT NULL,
  870. update_time timestamp DEFAULT NULL,
  871. PRIMARY KEY (id) ,
  872. CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group)
  873. );