2022-03-23 08:02:39 +00:00
|
|
|
CREATE SCHEMA notification;
|
|
|
|
|
|
|
|
CREATE TABLE notification.locks (
|
|
|
|
locker_id TEXT,
|
|
|
|
locked_until TIMESTAMPTZ(3),
|
2022-03-28 08:05:09 +00:00
|
|
|
view_name TEXT,
|
2022-04-19 06:26:12 +00:00
|
|
|
instance_id TEXT NOT NULL,
|
2022-03-23 08:02:39 +00:00
|
|
|
|
2022-04-19 06:26:12 +00:00
|
|
|
PRIMARY KEY (view_name, instance_id)
|
2022-03-23 08:02:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE notification.current_sequences (
|
2022-03-28 08:05:09 +00:00
|
|
|
view_name TEXT,
|
2022-03-23 08:02:39 +00:00
|
|
|
current_sequence BIGINT,
|
2022-03-28 08:05:09 +00:00
|
|
|
event_timestamp TIMESTAMPTZ,
|
|
|
|
last_successful_spooler_run TIMESTAMPTZ,
|
2022-04-19 06:26:12 +00:00
|
|
|
instance_id TEXT NOT NULL,
|
2022-03-23 08:02:39 +00:00
|
|
|
|
2022-04-19 06:26:12 +00:00
|
|
|
PRIMARY KEY (view_name, instance_id)
|
2022-03-23 08:02:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE notification.failed_events (
|
2022-03-28 08:05:09 +00:00
|
|
|
view_name TEXT,
|
2022-03-23 08:02:39 +00:00
|
|
|
failed_sequence BIGINT,
|
|
|
|
failure_count SMALLINT,
|
2022-03-28 08:05:09 +00:00
|
|
|
err_msg TEXT,
|
2022-04-19 06:26:12 +00:00
|
|
|
instance_id TEXT NOT NULL,
|
2022-03-23 08:02:39 +00:00
|
|
|
|
2022-04-19 06:26:12 +00:00
|
|
|
PRIMARY KEY (view_name, failed_sequence, instance_id)
|
2022-03-23 08:02:39 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE notification.notify_users (
|
|
|
|
id STRING NOT NULL,
|
|
|
|
creation_date TIMESTAMPTZ NULL,
|
|
|
|
change_date TIMESTAMPTZ NULL,
|
|
|
|
resource_owner STRING NULL,
|
|
|
|
user_name STRING NULL,
|
|
|
|
first_name STRING NULL,
|
|
|
|
last_name STRING NULL,
|
|
|
|
nick_name STRING NULL,
|
|
|
|
display_name STRING NULL,
|
|
|
|
preferred_language STRING NULL,
|
|
|
|
gender INT2 NULL,
|
|
|
|
last_email STRING NULL,
|
|
|
|
verified_email STRING NULL,
|
|
|
|
last_phone STRING NULL,
|
|
|
|
verified_phone STRING NULL,
|
|
|
|
sequence INT8 NULL,
|
|
|
|
password_set BOOL NULL,
|
|
|
|
login_names STRING NULL,
|
|
|
|
preferred_login_name STRING NULL,
|
|
|
|
instance_id STRING NULL,
|
|
|
|
|
|
|
|
PRIMARY KEY (id)
|
|
|
|
);
|