Skip to content

Commit

Permalink
fixed column type and added type column into tracing batch
Browse files Browse the repository at this point in the history
  • Loading branch information
CriMDev97 committed Nov 20, 2023
1 parent 6e8a8a1 commit 44cfd4e
Showing 1 changed file with 30 additions and 29 deletions.
59 changes: 30 additions & 29 deletions src/main/resources/db/changelog/changes/init_table/init_table.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
CREATE TABLE IF NOT EXISTS ESERVICE (
eservice_id VARCHAR (50) NOT NULL,
producer_id VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
producer_id VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255) NOT NULL,
event_id BIGINT,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
tmst_last_edit TIMESTAMP,
UNIQUE (eservice_id, producer_id, descriptor_id),
Expand All @@ -14,12 +14,12 @@ CREATE INDEX IF NOT EXISTS ESERVICE_INDEX_PRODUCER_ID ON ESERVICE USING hash (pr


CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE (
agreement_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
consumer_id VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50) NOT NULL,
agreement_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
consumer_id VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255) NOT NULL,
event_id BIGINT,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
tmst_last_edit TIMESTAMP,
UNIQUE (eservice_id, consumer_id, descriptor_id),
Expand All @@ -32,13 +32,13 @@ CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_DESCRIPTOR_ID ON CONSUMER_ESE

CREATE TABLE IF NOT EXISTS SIGNAL (
id SERIAL PRIMARY KEY,
correlation_id VARCHAR(50) NOT NULL,
correlation_id VARCHAR(255) NOT NULL,
signal_id BIGINT NOT NULL,
object_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
signal_type VARCHAR (50) NOT NULL,
tmst_insert TIMESTAMP NOT NULL,
object_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
signal_type VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE (signal_id, eservice_id)
);
CREATE INDEX IF NOT EXISTS SIGNAL_INDEX_SIGNAL_ID ON SIGNAL USING hash (signal_id);
Expand All @@ -47,33 +47,34 @@ CREATE INDEX IF NOT EXISTS SIGNAL_INDEX_ESERVICE_ID ON SIGNAL USING hash (eservi

CREATE TABLE IF NOT EXISTS DEAD_SIGNAL (
id SERIAL PRIMARY KEY,
correlation_id VARCHAR(50) NOT NULL,
correlation_id VARCHAR(255) NOT NULL,
signal_id BIGINT NOT NULL,
object_id VARCHAR (50) NOT NULL,
eservice_id VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
signal_type VARCHAR (50) NOT NULL,
tmst_insert TIMESTAMP NOT NULL,
object_id VARCHAR (255) NOT NULL,
eservice_id VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
signal_type VARCHAR (255) NOT NULL,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
error_reason VARCHAR(255) NOT NULL
);


CREATE TABLE IF NOT EXISTS TRACING_BATCH (
batch_id SERIAL PRIMARY KEY,
state VARCHAR (50) NOT NULL,
state VARCHAR (255) NOT NULL,
type VARCHAR (50) NOT NULL,
last_event_id BIGINT,
tmst_created TIMESTAMP NOT NULL
tmst_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);


CREATE TABLE IF NOT EXISTS DEAD_EVENT (
event_tmp_id SERIAL PRIMARY KEY,
tmst_insert TIMESTAMP,
tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
error_reason VARCHAR(255) NOT NULL,
event_id BIGINT NOT NULL,
event_type VARCHAR (50) NOT NULL,
object_type VARCHAR (50) NOT NULL,
descriptor_id VARCHAR (50),
eservice_id VARCHAR (50),
agreement_id VARCHAR (50)
event_type VARCHAR (255) NOT NULL,
object_type VARCHAR (255) NOT NULL,
descriptor_id VARCHAR (255),
eservice_id VARCHAR (255),
agreement_id VARCHAR (255)
);

0 comments on commit 44cfd4e

Please sign in to comment.