dolphinscheduler_postgre.sql 31 KB

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