From 7e40e335b75add0f0f3bb9176cbd203698254697 Mon Sep 17 00:00:00 2001 From: guanxiatao Date: Wed, 7 Aug 2019 21:33:42 +0800 Subject: [PATCH] add sql schema Signed-off-by: guanxiatao Signed-off-by: guanxiatao --- .../postgresql/0010_1.9.0_schema.up.sql | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/make/migrations/postgresql/0010_1.9.0_schema.up.sql b/make/migrations/postgresql/0010_1.9.0_schema.up.sql index 7ec76adeb..9303fa79b 100644 --- a/make/migrations/postgresql/0010_1.9.0_schema.up.sql +++ b/make/migrations/postgresql/0010_1.9.0_schema.up.sql @@ -139,3 +139,34 @@ create table schedule PRIMARY KEY (id) ); +/*add notification policy table*/ +create table notification_policy ( + id SERIAL NOT NULL, + name varchar(256), + project_id int NOT NULL, + enabled boolean NOT NULL DEFAULT true, + description text, + targets text, + event_types text, + creator varchar(256), + creation_time timestamp default CURRENT_TIMESTAMP, + update_time timestamp default CURRENT_TIMESTAMP, + PRIMARY KEY (id), + CONSTRAINT unique_project_id UNIQUE (project_id) + ); + +/*add notification job table*/ + CREATE TABLE notification_job ( + id SERIAL NOT NULL, + policy_id int NOT NULL, + status varchar(32), + /* event_type is the type of trigger event, eg. pushImage, pullImage, uploadChart... */ + event_type varchar(256), + /* notify_type is the type to notify event to user, eg. HTTP, Email... */ + notify_type varchar(256), + job_detail text, + job_uuid varchar(64), + creation_time timestamp default CURRENT_TIMESTAMP, + update_time timestamp default CURRENT_TIMESTAMP, + PRIMARY KEY (id) + );