dolphinscheduler_postgre.sql 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991
  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. dry_run int DEFAULT '0' ,
  224. process_instance_id int DEFAULT 0,
  225. process_definition_version int DEFAULT 0,
  226. PRIMARY KEY (id)
  227. ) ;
  228. create index priority_id_index on t_ds_command (process_instance_priority,id);
  229. --
  230. -- Table structure for table t_ds_datasource
  231. --
  232. DROP TABLE IF EXISTS t_ds_datasource;
  233. CREATE TABLE t_ds_datasource (
  234. id int NOT NULL ,
  235. name varchar(64) NOT NULL ,
  236. note varchar(255) DEFAULT NULL ,
  237. type int NOT NULL ,
  238. user_id int NOT NULL ,
  239. connection_params text NOT NULL ,
  240. create_time timestamp NOT NULL ,
  241. update_time timestamp DEFAULT NULL ,
  242. PRIMARY KEY (id),
  243. CONSTRAINT t_ds_datasource_name_un UNIQUE (name, type)
  244. ) ;
  245. --
  246. -- Table structure for table t_ds_error_command
  247. --
  248. DROP TABLE IF EXISTS t_ds_error_command;
  249. CREATE TABLE t_ds_error_command (
  250. id int NOT NULL ,
  251. command_type int DEFAULT NULL ,
  252. process_definition_code bigint NOT NULL ,
  253. command_param text ,
  254. task_depend_type int DEFAULT NULL ,
  255. failure_strategy int DEFAULT '0' ,
  256. warning_type int DEFAULT '0' ,
  257. warning_group_id int DEFAULT NULL ,
  258. schedule_time timestamp DEFAULT NULL ,
  259. start_time timestamp DEFAULT NULL ,
  260. executor_id int DEFAULT NULL ,
  261. update_time timestamp DEFAULT NULL ,
  262. process_instance_priority int DEFAULT NULL ,
  263. worker_group varchar(64),
  264. environment_code bigint DEFAULT '-1',
  265. dry_run int DEFAULT '0' ,
  266. message text ,
  267. process_instance_id int DEFAULT 0,
  268. process_definition_version int DEFAULT 0,
  269. PRIMARY KEY (id)
  270. );
  271. --
  272. -- Table structure for table t_ds_master_server
  273. --
  274. --
  275. -- Table structure for table t_ds_process_definition
  276. --
  277. DROP TABLE IF EXISTS t_ds_process_definition;
  278. CREATE TABLE t_ds_process_definition (
  279. id int NOT NULL ,
  280. code bigint NOT NULL,
  281. name varchar(255) DEFAULT NULL ,
  282. version int NOT NULL ,
  283. description text ,
  284. project_code bigint DEFAULT NULL ,
  285. release_state int DEFAULT NULL ,
  286. user_id int DEFAULT NULL ,
  287. global_params text ,
  288. locations text ,
  289. warning_group_id int DEFAULT NULL ,
  290. flag int DEFAULT NULL ,
  291. timeout int DEFAULT '0' ,
  292. tenant_id int DEFAULT '-1' ,
  293. execution_type int DEFAULT '0',
  294. create_time timestamp DEFAULT NULL ,
  295. update_time timestamp DEFAULT NULL ,
  296. PRIMARY KEY (id) ,
  297. CONSTRAINT process_definition_unique UNIQUE (name, project_code)
  298. ) ;
  299. create index process_definition_index on t_ds_process_definition (code,id);
  300. DROP TABLE IF EXISTS t_ds_process_definition_log;
  301. CREATE TABLE t_ds_process_definition_log (
  302. id int NOT NULL ,
  303. code bigint NOT NULL,
  304. name varchar(255) DEFAULT NULL ,
  305. version int NOT NULL ,
  306. description text ,
  307. project_code bigint DEFAULT NULL ,
  308. release_state int DEFAULT NULL ,
  309. user_id int DEFAULT NULL ,
  310. global_params text ,
  311. locations text ,
  312. warning_group_id int DEFAULT NULL ,
  313. flag int DEFAULT NULL ,
  314. timeout int DEFAULT '0' ,
  315. tenant_id int DEFAULT '-1' ,
  316. execution_type int DEFAULT '0',
  317. operator int DEFAULT NULL ,
  318. operate_time timestamp DEFAULT NULL ,
  319. create_time timestamp DEFAULT NULL ,
  320. update_time timestamp DEFAULT NULL ,
  321. PRIMARY KEY (id)
  322. ) ;
  323. DROP TABLE IF EXISTS t_ds_task_definition;
  324. CREATE TABLE t_ds_task_definition (
  325. id int NOT NULL ,
  326. code bigint NOT NULL,
  327. name varchar(255) DEFAULT NULL ,
  328. version int NOT NULL ,
  329. description text ,
  330. project_code bigint DEFAULT NULL ,
  331. user_id int DEFAULT NULL ,
  332. task_type varchar(50) DEFAULT NULL ,
  333. task_params text ,
  334. flag int DEFAULT NULL ,
  335. task_priority int DEFAULT NULL ,
  336. worker_group varchar(255) DEFAULT NULL ,
  337. environment_code bigint DEFAULT '-1',
  338. fail_retry_times int DEFAULT NULL ,
  339. fail_retry_interval int DEFAULT NULL ,
  340. timeout_flag int DEFAULT NULL ,
  341. timeout_notify_strategy int DEFAULT NULL ,
  342. timeout int DEFAULT '0' ,
  343. delay_time int DEFAULT '0' ,
  344. resource_ids text ,
  345. create_time timestamp DEFAULT NULL ,
  346. update_time timestamp DEFAULT NULL ,
  347. PRIMARY KEY (id)
  348. ) ;
  349. create index task_definition_index on t_ds_task_definition (project_code,id);
  350. DROP TABLE IF EXISTS t_ds_task_definition_log;
  351. CREATE TABLE t_ds_task_definition_log (
  352. id int NOT NULL ,
  353. code bigint NOT NULL,
  354. name varchar(255) DEFAULT NULL ,
  355. version int NOT NULL ,
  356. description text ,
  357. project_code bigint DEFAULT NULL ,
  358. user_id int DEFAULT NULL ,
  359. task_type varchar(50) DEFAULT NULL ,
  360. task_params text ,
  361. flag int DEFAULT NULL ,
  362. task_priority int DEFAULT NULL ,
  363. worker_group varchar(255) DEFAULT NULL ,
  364. environment_code bigint DEFAULT '-1',
  365. fail_retry_times int DEFAULT NULL ,
  366. fail_retry_interval int DEFAULT NULL ,
  367. timeout_flag int DEFAULT NULL ,
  368. timeout_notify_strategy int DEFAULT NULL ,
  369. timeout int DEFAULT '0' ,
  370. delay_time int DEFAULT '0' ,
  371. resource_ids text ,
  372. operator int DEFAULT NULL ,
  373. operate_time timestamp DEFAULT NULL ,
  374. create_time timestamp DEFAULT NULL ,
  375. update_time timestamp DEFAULT NULL ,
  376. PRIMARY KEY (id)
  377. ) ;
  378. DROP TABLE IF EXISTS t_ds_process_task_relation;
  379. CREATE TABLE t_ds_process_task_relation (
  380. id int NOT NULL ,
  381. name varchar(255) DEFAULT NULL ,
  382. project_code bigint DEFAULT NULL ,
  383. process_definition_code bigint DEFAULT NULL ,
  384. process_definition_version int DEFAULT NULL ,
  385. pre_task_code bigint DEFAULT NULL ,
  386. pre_task_version int DEFAULT '0' ,
  387. post_task_code bigint DEFAULT NULL ,
  388. post_task_version int DEFAULT '0' ,
  389. condition_type int DEFAULT NULL ,
  390. condition_params text ,
  391. create_time timestamp DEFAULT NULL ,
  392. update_time timestamp DEFAULT NULL ,
  393. PRIMARY KEY (id)
  394. ) ;
  395. DROP TABLE IF EXISTS t_ds_process_task_relation_log;
  396. CREATE TABLE t_ds_process_task_relation_log (
  397. id int NOT NULL ,
  398. name varchar(255) DEFAULT NULL ,
  399. project_code bigint DEFAULT NULL ,
  400. process_definition_code bigint DEFAULT NULL ,
  401. process_definition_version int DEFAULT NULL ,
  402. pre_task_code bigint DEFAULT NULL ,
  403. pre_task_version int DEFAULT '0' ,
  404. post_task_code bigint DEFAULT NULL ,
  405. post_task_version int DEFAULT '0' ,
  406. condition_type int DEFAULT NULL ,
  407. condition_params text ,
  408. operator int DEFAULT NULL ,
  409. operate_time timestamp DEFAULT NULL ,
  410. create_time timestamp DEFAULT NULL ,
  411. update_time timestamp DEFAULT NULL ,
  412. PRIMARY KEY (id)
  413. ) ;
  414. --
  415. -- Table structure for table t_ds_process_instance
  416. --
  417. DROP TABLE IF EXISTS t_ds_process_instance;
  418. CREATE TABLE t_ds_process_instance (
  419. id int NOT NULL ,
  420. name varchar(255) DEFAULT NULL ,
  421. process_definition_code bigint DEFAULT NULL ,
  422. process_definition_version int DEFAULT NULL ,
  423. state int DEFAULT NULL ,
  424. recovery int DEFAULT NULL ,
  425. start_time timestamp DEFAULT NULL ,
  426. end_time timestamp DEFAULT NULL ,
  427. run_times int DEFAULT NULL ,
  428. host varchar(135) DEFAULT NULL ,
  429. command_type int DEFAULT NULL ,
  430. command_param text ,
  431. task_depend_type int DEFAULT NULL ,
  432. max_try_times int DEFAULT '0' ,
  433. failure_strategy int DEFAULT '0' ,
  434. warning_type int DEFAULT '0' ,
  435. warning_group_id int DEFAULT NULL ,
  436. schedule_time timestamp DEFAULT NULL ,
  437. command_start_time timestamp DEFAULT NULL ,
  438. global_params text ,
  439. process_instance_json text ,
  440. flag int DEFAULT '1' ,
  441. update_time timestamp NULL ,
  442. is_sub_process int DEFAULT '0' ,
  443. executor_id int NOT NULL ,
  444. history_cmd text ,
  445. dependence_schedule_times text ,
  446. process_instance_priority int DEFAULT NULL ,
  447. worker_group varchar(64) ,
  448. environment_code bigint DEFAULT '-1',
  449. timeout int DEFAULT '0' ,
  450. tenant_id int NOT NULL DEFAULT '-1' ,
  451. var_pool text ,
  452. dry_run int DEFAULT '0' ,
  453. next_process_instance_id int DEFAULT '0',
  454. PRIMARY KEY (id)
  455. ) ;
  456. create index process_instance_index on t_ds_process_instance (process_definition_code,id);
  457. create index start_time_index on t_ds_process_instance (start_time);
  458. --
  459. -- Table structure for table t_ds_project
  460. --
  461. DROP TABLE IF EXISTS t_ds_project;
  462. CREATE TABLE t_ds_project (
  463. id int NOT NULL ,
  464. name varchar(100) DEFAULT NULL ,
  465. code bigint NOT NULL,
  466. description varchar(200) DEFAULT NULL ,
  467. user_id int DEFAULT NULL ,
  468. flag int DEFAULT '1' ,
  469. create_time timestamp DEFAULT CURRENT_TIMESTAMP ,
  470. update_time timestamp DEFAULT CURRENT_TIMESTAMP ,
  471. PRIMARY KEY (id)
  472. ) ;
  473. create index user_id_index on t_ds_project (user_id);
  474. --
  475. -- Table structure for table t_ds_queue
  476. --
  477. DROP TABLE IF EXISTS t_ds_queue;
  478. CREATE TABLE t_ds_queue (
  479. id int NOT NULL ,
  480. queue_name varchar(64) DEFAULT NULL ,
  481. queue varchar(64) DEFAULT NULL ,
  482. create_time timestamp DEFAULT NULL ,
  483. update_time timestamp DEFAULT NULL ,
  484. PRIMARY KEY (id)
  485. );
  486. --
  487. -- Table structure for table t_ds_relation_datasource_user
  488. --
  489. DROP TABLE IF EXISTS t_ds_relation_datasource_user;
  490. CREATE TABLE t_ds_relation_datasource_user (
  491. id int NOT NULL ,
  492. user_id int NOT NULL ,
  493. datasource_id int DEFAULT NULL ,
  494. perm int DEFAULT '1' ,
  495. create_time timestamp DEFAULT NULL ,
  496. update_time timestamp DEFAULT NULL ,
  497. PRIMARY KEY (id)
  498. ) ;
  499. ;
  500. --
  501. -- Table structure for table t_ds_relation_process_instance
  502. --
  503. DROP TABLE IF EXISTS t_ds_relation_process_instance;
  504. CREATE TABLE t_ds_relation_process_instance (
  505. id int NOT NULL ,
  506. parent_process_instance_id int DEFAULT NULL ,
  507. parent_task_instance_id int DEFAULT NULL ,
  508. process_instance_id int DEFAULT NULL ,
  509. PRIMARY KEY (id)
  510. ) ;
  511. --
  512. -- Table structure for table t_ds_relation_project_user
  513. --
  514. DROP TABLE IF EXISTS t_ds_relation_project_user;
  515. CREATE TABLE t_ds_relation_project_user (
  516. id int NOT NULL ,
  517. user_id int NOT NULL ,
  518. project_id int DEFAULT NULL ,
  519. perm int DEFAULT '1' ,
  520. create_time timestamp DEFAULT NULL ,
  521. update_time timestamp DEFAULT NULL ,
  522. PRIMARY KEY (id)
  523. ) ;
  524. create index relation_project_user_id_index on t_ds_relation_project_user (user_id);
  525. --
  526. -- Table structure for table t_ds_relation_resources_user
  527. --
  528. DROP TABLE IF EXISTS t_ds_relation_resources_user;
  529. CREATE TABLE t_ds_relation_resources_user (
  530. id int NOT NULL ,
  531. user_id int NOT NULL ,
  532. resources_id int DEFAULT NULL ,
  533. perm int DEFAULT '1' ,
  534. create_time timestamp DEFAULT NULL ,
  535. update_time timestamp DEFAULT NULL ,
  536. PRIMARY KEY (id)
  537. ) ;
  538. --
  539. -- Table structure for table t_ds_relation_udfs_user
  540. --
  541. DROP TABLE IF EXISTS t_ds_relation_udfs_user;
  542. CREATE TABLE t_ds_relation_udfs_user (
  543. id int NOT NULL ,
  544. user_id int NOT NULL ,
  545. udf_id int DEFAULT NULL ,
  546. perm int DEFAULT '1' ,
  547. create_time timestamp DEFAULT NULL ,
  548. update_time timestamp DEFAULT NULL ,
  549. PRIMARY KEY (id)
  550. ) ;
  551. ;
  552. --
  553. -- Table structure for table t_ds_resources
  554. --
  555. DROP TABLE IF EXISTS t_ds_resources;
  556. CREATE TABLE t_ds_resources (
  557. id int NOT NULL ,
  558. alias varchar(64) DEFAULT NULL ,
  559. file_name varchar(64) DEFAULT NULL ,
  560. description varchar(255) DEFAULT NULL ,
  561. user_id int DEFAULT NULL ,
  562. type int DEFAULT NULL ,
  563. size bigint DEFAULT NULL ,
  564. create_time timestamp DEFAULT NULL ,
  565. update_time timestamp DEFAULT NULL ,
  566. pid int,
  567. full_name varchar(64),
  568. is_directory int,
  569. PRIMARY KEY (id),
  570. CONSTRAINT t_ds_resources_un UNIQUE (full_name, type)
  571. ) ;
  572. --
  573. -- Table structure for table t_ds_schedules
  574. --
  575. DROP TABLE IF EXISTS t_ds_schedules;
  576. CREATE TABLE t_ds_schedules (
  577. id int NOT NULL ,
  578. process_definition_code bigint NOT NULL ,
  579. start_time timestamp NOT NULL ,
  580. end_time timestamp NOT NULL ,
  581. timezone_id varchar(40) default NULL ,
  582. crontab varchar(255) NOT NULL ,
  583. failure_strategy int NOT NULL ,
  584. user_id int NOT NULL ,
  585. release_state int NOT NULL ,
  586. warning_type int NOT NULL ,
  587. warning_group_id int DEFAULT NULL ,
  588. process_instance_priority int DEFAULT NULL ,
  589. worker_group varchar(64),
  590. environment_code bigint DEFAULT '-1',
  591. create_time timestamp NOT NULL ,
  592. update_time timestamp NOT NULL ,
  593. PRIMARY KEY (id)
  594. );
  595. --
  596. -- Table structure for table t_ds_session
  597. --
  598. DROP TABLE IF EXISTS t_ds_session;
  599. CREATE TABLE t_ds_session (
  600. id varchar(64) NOT NULL ,
  601. user_id int DEFAULT NULL ,
  602. ip varchar(45) DEFAULT NULL ,
  603. last_login_time timestamp DEFAULT NULL ,
  604. PRIMARY KEY (id)
  605. );
  606. --
  607. -- Table structure for table t_ds_task_instance
  608. --
  609. DROP TABLE IF EXISTS t_ds_task_instance;
  610. CREATE TABLE t_ds_task_instance (
  611. id int NOT NULL ,
  612. name varchar(255) DEFAULT NULL ,
  613. task_type varchar(50) DEFAULT NULL ,
  614. task_code bigint NOT NULL,
  615. task_definition_version int DEFAULT NULL ,
  616. process_instance_id int DEFAULT NULL ,
  617. state int DEFAULT NULL ,
  618. submit_time timestamp DEFAULT NULL ,
  619. start_time timestamp DEFAULT NULL ,
  620. end_time timestamp DEFAULT NULL ,
  621. host varchar(135) DEFAULT NULL ,
  622. execute_path varchar(200) DEFAULT NULL ,
  623. log_path varchar(200) DEFAULT NULL ,
  624. alert_flag int DEFAULT NULL ,
  625. retry_times int DEFAULT '0' ,
  626. pid int DEFAULT NULL ,
  627. app_link text ,
  628. task_params text ,
  629. flag int DEFAULT '1' ,
  630. retry_interval int DEFAULT NULL ,
  631. max_retry_times int DEFAULT NULL ,
  632. task_instance_priority int DEFAULT NULL ,
  633. worker_group varchar(64),
  634. environment_code bigint DEFAULT '-1',
  635. environment_config text,
  636. executor_id int DEFAULT NULL ,
  637. first_submit_time timestamp DEFAULT NULL ,
  638. delay_time int DEFAULT '0' ,
  639. var_pool text ,
  640. dry_run int DEFAULT '0' ,
  641. PRIMARY KEY (id),
  642. CONSTRAINT foreign_key_instance_id FOREIGN KEY(process_instance_id) REFERENCES t_ds_process_instance(id) ON DELETE CASCADE
  643. ) ;
  644. --
  645. -- Table structure for table t_ds_tenant
  646. --
  647. DROP TABLE IF EXISTS t_ds_tenant;
  648. CREATE TABLE t_ds_tenant (
  649. id int NOT NULL ,
  650. tenant_code varchar(64) DEFAULT NULL ,
  651. description varchar(255) DEFAULT NULL ,
  652. queue_id int DEFAULT NULL ,
  653. create_time timestamp DEFAULT NULL ,
  654. update_time timestamp DEFAULT NULL ,
  655. PRIMARY KEY (id)
  656. ) ;
  657. --
  658. -- Table structure for table t_ds_udfs
  659. --
  660. DROP TABLE IF EXISTS t_ds_udfs;
  661. CREATE TABLE t_ds_udfs (
  662. id int NOT NULL ,
  663. user_id int NOT NULL ,
  664. func_name varchar(100) NOT NULL ,
  665. class_name varchar(255) NOT NULL ,
  666. type int NOT NULL ,
  667. arg_types varchar(255) DEFAULT NULL ,
  668. database varchar(255) DEFAULT NULL ,
  669. description varchar(255) DEFAULT NULL ,
  670. resource_id int NOT NULL ,
  671. resource_name varchar(255) NOT NULL ,
  672. create_time timestamp NOT NULL ,
  673. update_time timestamp NOT NULL ,
  674. PRIMARY KEY (id)
  675. ) ;
  676. --
  677. -- Table structure for table t_ds_user
  678. --
  679. DROP TABLE IF EXISTS t_ds_user;
  680. CREATE TABLE t_ds_user (
  681. id int NOT NULL ,
  682. user_name varchar(64) DEFAULT NULL ,
  683. user_password varchar(64) DEFAULT NULL ,
  684. user_type int DEFAULT NULL ,
  685. email varchar(64) DEFAULT NULL ,
  686. phone varchar(11) DEFAULT NULL ,
  687. tenant_id int DEFAULT NULL ,
  688. create_time timestamp DEFAULT NULL ,
  689. update_time timestamp DEFAULT NULL ,
  690. queue varchar(64) DEFAULT NULL ,
  691. state int DEFAULT 1 ,
  692. PRIMARY KEY (id)
  693. );
  694. comment on column t_ds_user.state is 'state 0:disable 1:enable';
  695. --
  696. -- Table structure for table t_ds_version
  697. --
  698. DROP TABLE IF EXISTS t_ds_version;
  699. CREATE TABLE t_ds_version (
  700. id int NOT NULL ,
  701. version varchar(200) NOT NULL,
  702. PRIMARY KEY (id)
  703. ) ;
  704. create index version_index on t_ds_version(version);
  705. --
  706. -- Table structure for table t_ds_worker_group
  707. --
  708. DROP TABLE IF EXISTS t_ds_worker_group;
  709. CREATE TABLE t_ds_worker_group (
  710. id bigint NOT NULL ,
  711. name varchar(255) NOT NULL ,
  712. addr_list text DEFAULT NULL ,
  713. create_time timestamp DEFAULT NULL ,
  714. update_time timestamp DEFAULT NULL ,
  715. PRIMARY KEY (id) ,
  716. CONSTRAINT name_unique UNIQUE (name)
  717. ) ;
  718. --
  719. -- Table structure for table t_ds_worker_server
  720. --
  721. DROP TABLE IF EXISTS t_ds_worker_server;
  722. CREATE TABLE t_ds_worker_server (
  723. id int NOT NULL ,
  724. host varchar(45) DEFAULT NULL ,
  725. port int DEFAULT NULL ,
  726. zk_directory varchar(64) DEFAULT NULL ,
  727. res_info varchar(255) DEFAULT NULL ,
  728. create_time timestamp DEFAULT NULL ,
  729. last_heartbeat_time timestamp DEFAULT NULL ,
  730. PRIMARY KEY (id)
  731. ) ;
  732. DROP SEQUENCE IF EXISTS t_ds_access_token_id_sequence;
  733. CREATE SEQUENCE t_ds_access_token_id_sequence;
  734. ALTER TABLE t_ds_access_token ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_access_token_id_sequence');
  735. DROP SEQUENCE IF EXISTS t_ds_alert_id_sequence;
  736. CREATE SEQUENCE t_ds_alert_id_sequence;
  737. ALTER TABLE t_ds_alert ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_alert_id_sequence');
  738. DROP SEQUENCE IF EXISTS t_ds_alertgroup_id_sequence;
  739. CREATE SEQUENCE t_ds_alertgroup_id_sequence;
  740. ALTER TABLE t_ds_alertgroup ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_alertgroup_id_sequence');
  741. DROP SEQUENCE IF EXISTS t_ds_command_id_sequence;
  742. CREATE SEQUENCE t_ds_command_id_sequence;
  743. ALTER TABLE t_ds_command ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_command_id_sequence');
  744. DROP SEQUENCE IF EXISTS t_ds_datasource_id_sequence;
  745. CREATE SEQUENCE t_ds_datasource_id_sequence;
  746. ALTER TABLE t_ds_datasource ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_datasource_id_sequence');
  747. DROP SEQUENCE IF EXISTS t_ds_process_definition_id_sequence;
  748. CREATE SEQUENCE t_ds_process_definition_id_sequence;
  749. ALTER TABLE t_ds_process_definition ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_definition_id_sequence');
  750. DROP SEQUENCE IF EXISTS t_ds_process_definition_log_id_sequence;
  751. CREATE SEQUENCE t_ds_process_definition_log_id_sequence;
  752. ALTER TABLE t_ds_process_definition_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_definition_log_id_sequence');
  753. DROP SEQUENCE IF EXISTS t_ds_task_definition_id_sequence;
  754. CREATE SEQUENCE t_ds_task_definition_id_sequence;
  755. ALTER TABLE t_ds_task_definition ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_definition_id_sequence');
  756. DROP SEQUENCE IF EXISTS t_ds_task_definition_log_id_sequence;
  757. CREATE SEQUENCE t_ds_task_definition_log_id_sequence;
  758. ALTER TABLE t_ds_task_definition_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_definition_log_id_sequence');
  759. DROP SEQUENCE IF EXISTS t_ds_process_task_relation_id_sequence;
  760. CREATE SEQUENCE t_ds_process_task_relation_id_sequence;
  761. ALTER TABLE t_ds_process_task_relation ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_task_relation_id_sequence');
  762. DROP SEQUENCE IF EXISTS t_ds_process_task_relation_log_id_sequence;
  763. CREATE SEQUENCE t_ds_process_task_relation_log_id_sequence;
  764. ALTER TABLE t_ds_process_task_relation_log ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_task_relation_log_id_sequence');
  765. DROP SEQUENCE IF EXISTS t_ds_process_instance_id_sequence;
  766. CREATE SEQUENCE t_ds_process_instance_id_sequence;
  767. ALTER TABLE t_ds_process_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_process_instance_id_sequence');
  768. DROP SEQUENCE IF EXISTS t_ds_project_id_sequence;
  769. CREATE SEQUENCE t_ds_project_id_sequence;
  770. ALTER TABLE t_ds_project ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_project_id_sequence');
  771. DROP SEQUENCE IF EXISTS t_ds_queue_id_sequence;
  772. CREATE SEQUENCE t_ds_queue_id_sequence;
  773. ALTER TABLE t_ds_queue ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_queue_id_sequence');
  774. DROP SEQUENCE IF EXISTS t_ds_relation_datasource_user_id_sequence;
  775. CREATE SEQUENCE t_ds_relation_datasource_user_id_sequence;
  776. ALTER TABLE t_ds_relation_datasource_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_datasource_user_id_sequence');
  777. DROP SEQUENCE IF EXISTS t_ds_relation_process_instance_id_sequence;
  778. CREATE SEQUENCE t_ds_relation_process_instance_id_sequence;
  779. ALTER TABLE t_ds_relation_process_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_process_instance_id_sequence');
  780. DROP SEQUENCE IF EXISTS t_ds_relation_project_user_id_sequence;
  781. CREATE SEQUENCE t_ds_relation_project_user_id_sequence;
  782. ALTER TABLE t_ds_relation_project_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_project_user_id_sequence');
  783. DROP SEQUENCE IF EXISTS t_ds_relation_resources_user_id_sequence;
  784. CREATE SEQUENCE t_ds_relation_resources_user_id_sequence;
  785. ALTER TABLE t_ds_relation_resources_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_resources_user_id_sequence');
  786. DROP SEQUENCE IF EXISTS t_ds_relation_udfs_user_id_sequence;
  787. CREATE SEQUENCE t_ds_relation_udfs_user_id_sequence;
  788. ALTER TABLE t_ds_relation_udfs_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_relation_udfs_user_id_sequence');
  789. DROP SEQUENCE IF EXISTS t_ds_resources_id_sequence;
  790. CREATE SEQUENCE t_ds_resources_id_sequence;
  791. ALTER TABLE t_ds_resources ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_resources_id_sequence');
  792. DROP SEQUENCE IF EXISTS t_ds_schedules_id_sequence;
  793. CREATE SEQUENCE t_ds_schedules_id_sequence;
  794. ALTER TABLE t_ds_schedules ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_schedules_id_sequence');
  795. DROP SEQUENCE IF EXISTS t_ds_task_instance_id_sequence;
  796. CREATE SEQUENCE t_ds_task_instance_id_sequence;
  797. ALTER TABLE t_ds_task_instance ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_task_instance_id_sequence');
  798. DROP SEQUENCE IF EXISTS t_ds_tenant_id_sequence;
  799. CREATE SEQUENCE t_ds_tenant_id_sequence;
  800. ALTER TABLE t_ds_tenant ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_tenant_id_sequence');
  801. DROP SEQUENCE IF EXISTS t_ds_udfs_id_sequence;
  802. CREATE SEQUENCE t_ds_udfs_id_sequence;
  803. ALTER TABLE t_ds_udfs ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_udfs_id_sequence');
  804. DROP SEQUENCE IF EXISTS t_ds_user_id_sequence;
  805. CREATE SEQUENCE t_ds_user_id_sequence;
  806. ALTER TABLE t_ds_user ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_user_id_sequence');
  807. DROP SEQUENCE IF EXISTS t_ds_version_id_sequence;
  808. CREATE SEQUENCE t_ds_version_id_sequence;
  809. ALTER TABLE t_ds_version ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_version_id_sequence');
  810. DROP SEQUENCE IF EXISTS t_ds_worker_group_id_sequence;
  811. CREATE SEQUENCE t_ds_worker_group_id_sequence;
  812. ALTER TABLE t_ds_worker_group ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_group_id_sequence');
  813. DROP SEQUENCE IF EXISTS t_ds_worker_server_id_sequence;
  814. CREATE SEQUENCE t_ds_worker_server_id_sequence;
  815. ALTER TABLE t_ds_worker_server ALTER COLUMN id SET DEFAULT NEXTVAL('t_ds_worker_server_id_sequence');
  816. -- Records of t_ds_user?user : admin , password : dolphinscheduler123
  817. INSERT INTO t_ds_user(user_name, user_password, user_type, email, phone, tenant_id, state, create_time, update_time)
  818. VALUES ('admin', '7ad2410b2f4c074479a8937a28a22b8f', '0', 'xxx@qq.com', '', '0', 1, '2018-03-27 15:48:50', '2018-10-24 17:40:22');
  819. -- Records of t_ds_alertgroup, default admin warning group
  820. INSERT INTO t_ds_alertgroup(alert_instance_ids, create_user_id, group_name, description, create_time, update_time)
  821. VALUES ('1,2', 1, 'default admin warning group', 'default admin warning group', '2018-11-29 10:20:39', '2018-11-29 10:20:39');
  822. -- Records of t_ds_queue,default queue name : default
  823. INSERT INTO t_ds_queue(queue_name, queue, create_time, update_time)
  824. VALUES ('default', 'default', '2018-11-29 10:22:33', '2018-11-29 10:22:33');
  825. -- Records of t_ds_queue,default queue name : default
  826. INSERT INTO t_ds_version(version) VALUES ('1.4.0');
  827. --
  828. -- Table structure for table t_ds_plugin_define
  829. --
  830. DROP TABLE IF EXISTS t_ds_plugin_define;
  831. CREATE TABLE t_ds_plugin_define (
  832. id serial NOT NULL,
  833. plugin_name varchar(100) NOT NULL,
  834. plugin_type varchar(100) NOT NULL,
  835. plugin_params text NULL,
  836. create_time timestamp NULL,
  837. update_time timestamp NULL,
  838. CONSTRAINT t_ds_plugin_define_pk PRIMARY KEY (id),
  839. CONSTRAINT t_ds_plugin_define_un UNIQUE (plugin_name, plugin_type)
  840. );
  841. --
  842. -- Table structure for table t_ds_alert_plugin_instance
  843. --
  844. DROP TABLE IF EXISTS t_ds_alert_plugin_instance;
  845. CREATE TABLE t_ds_alert_plugin_instance (
  846. id serial NOT NULL,
  847. plugin_define_id int4 NOT NULL,
  848. plugin_instance_params text NULL,
  849. create_time timestamp NULL,
  850. update_time timestamp NULL,
  851. instance_name varchar(200) NULL,
  852. CONSTRAINT t_ds_alert_plugin_instance_pk PRIMARY KEY (id)
  853. );
  854. --
  855. -- Table structure for table t_ds_environment
  856. --
  857. DROP TABLE IF EXISTS t_ds_environment;
  858. CREATE TABLE t_ds_environment (
  859. id serial NOT NULL,
  860. code bigint NOT NULL,
  861. name varchar(100) DEFAULT NULL,
  862. config text DEFAULT NULL,
  863. description text,
  864. operator int DEFAULT NULL,
  865. create_time timestamp DEFAULT NULL,
  866. update_time timestamp DEFAULT NULL,
  867. PRIMARY KEY (id),
  868. CONSTRAINT environment_name_unique UNIQUE (name),
  869. CONSTRAINT environment_code_unique UNIQUE (code)
  870. );
  871. --
  872. -- Table structure for table t_ds_environment_worker_group_relation
  873. --
  874. DROP TABLE IF EXISTS t_ds_environment_worker_group_relation;
  875. CREATE TABLE t_ds_environment_worker_group_relation (
  876. id serial NOT NULL,
  877. environment_code bigint NOT NULL,
  878. worker_group varchar(255) NOT NULL,
  879. operator int DEFAULT NULL,
  880. create_time timestamp DEFAULT NULL,
  881. update_time timestamp DEFAULT NULL,
  882. PRIMARY KEY (id) ,
  883. CONSTRAINT environment_worker_group_unique UNIQUE (environment_code,worker_group)
  884. );