From 44cfd4e0abff0064b125e6f2cafce3336570a97a Mon Sep 17 00:00:00 2001 From: "cristopher.moccia" Date: Mon, 20 Nov 2023 16:41:08 +0100 Subject: [PATCH] fixed column type and added type column into tracing batch --- .../changes/init_table/init_table.sql | 59 ++++++++++--------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/src/main/resources/db/changelog/changes/init_table/init_table.sql b/src/main/resources/db/changelog/changes/init_table/init_table.sql index eda3250..b033211 100644 --- a/src/main/resources/db/changelog/changes/init_table/init_table.sql +++ b/src/main/resources/db/changelog/changes/init_table/init_table.sql @@ -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), @@ -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), @@ -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); @@ -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) ); \ No newline at end of file