dolphinscheduler_postgre.sql 31 KB

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