2019-02-22 08:01:16 +01:00
|
|
|
/*add robot account table*/
|
2019-01-09 02:40:17 +01:00
|
|
|
CREATE TABLE robot (
|
2019-01-07 10:26:50 +01:00
|
|
|
id SERIAL PRIMARY KEY NOT NULL,
|
|
|
|
name varchar(255),
|
|
|
|
description varchar(1024),
|
|
|
|
project_id int,
|
2019-02-23 07:13:02 +01:00
|
|
|
expiresat bigint,
|
2019-01-07 10:26:50 +01:00
|
|
|
disabled boolean DEFAULT false NOT NULL,
|
|
|
|
creation_time timestamp default CURRENT_TIMESTAMP,
|
|
|
|
update_time timestamp default CURRENT_TIMESTAMP,
|
|
|
|
CONSTRAINT unique_robot UNIQUE (name, project_id)
|
|
|
|
);
|
|
|
|
|
2019-02-22 08:01:16 +01:00
|
|
|
CREATE TRIGGER robot_update_time_at_modtime BEFORE UPDATE ON robot FOR EACH ROW EXECUTE PROCEDURE update_update_time_at_column();
|
|
|
|
|
2019-03-28 05:46:35 +01:00
|
|
|
CREATE TABLE oidc_user (
|
|
|
|
id SERIAL NOT NULL,
|
|
|
|
user_id int NOT NULL,
|
|
|
|
secret varchar(255) NOT NULL,
|
|
|
|
/*
|
|
|
|
Subject and Issuer
|
|
|
|
Subject: Subject Identifier.
|
|
|
|
Issuer: Issuer Identifier for the Issuer of the response.
|
|
|
|
The sub (subject) and iss (issuer) Claims, used together, are the only Claims that an RP can rely upon as a stable identifier for the End-User
|
|
|
|
*/
|
|
|
|
subiss varchar(255) NOT NULL,
|
|
|
|
creation_time timestamp default CURRENT_TIMESTAMP,
|
|
|
|
update_time timestamp default CURRENT_TIMESTAMP,
|
|
|
|
PRIMARY KEY (id),
|
|
|
|
UNIQUE (subiss)
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TRIGGER odic_user_update_time_at_modtime BEFORE UPDATE ON oidc_user FOR EACH ROW EXECUTE PROCEDURE update_update_time_at_column();
|
|
|
|
|
2019-02-22 08:01:16 +01:00
|
|
|
/*add master role*/
|
|
|
|
INSERT INTO role (role_code, name) VALUES ('DRWS', 'master');
|
|
|
|
|
|
|
|
/*delete replication jobs whose policy has been marked as "deleted"*/
|
|
|
|
DELETE FROM replication_job AS j
|
|
|
|
USING replication_policy AS p
|
|
|
|
WHERE j.policy_id = p.id AND p.deleted = TRUE;
|
|
|
|
|
|
|
|
/*delete replication policy which has been marked as "deleted"*/
|
|
|
|
DELETE FROM replication_policy AS p
|
|
|
|
WHERE p.deleted = TRUE;
|