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 e7ce328..c827493 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,5 +1,5 @@ CREATE TABLE IF NOT EXISTS ESERVICE ( - eservice_id VARCHAR (50) UNIQUE NOT NULL, + eservice_id VARCHAR (50) NOT NULL, producer_id VARCHAR (50) NOT NULL, descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , @@ -15,21 +15,22 @@ CREATE INDEX IF NOT EXISTS ESERVICE_INDEX_PRODUCER_ID ON ESERVICE USING hash (pr CREATE INDEX IF NOT EXISTS ESERVICE_INDEX_DESCRIPTOR_ID ON ESERVICE USING hash (descriptor_id); + CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE ( - eservice_id VARCHAR (50) NOT NULL, - consumer_id VARCHAR (50) NOT NULL, - agreement_id VARCHAR (50) NOT NULL, - descriptor_id VARCHAR (50) NOT NULL, - event_id BIGINT , - state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - tmst_last_edit TIMESTAMP, - UNIQUE (eservice_id, consumer_id, descriptor_id), - PRIMARY KEY (eservice_id, consumer_id, descriptor_id) + agreement_id VARCHAR (50) NOT NULL, + eservice_id VARCHAR (50) NOT NULL, + consumer_id VARCHAR (50) NOT NULL, + descriptor_id VARCHAR (50) NOT NULL, + event_id BIGINT , + state VARCHAR (50) NOT NULL, + tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + tmst_last_edit TIMESTAMP, + PRIMARY KEY (agreement_id) ); + CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_ID ON CONSUMER_ESERVICE USING hash (eservice_id); CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_CONSUMER_ID ON CONSUMER_ESERVICE USING hash (consumer_id); -CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_DESCRIPTOR_ID ON CONSUMER_ESERVICE USING hash (descriptor_id); + CREATE TABLE IF NOT EXISTS SIGNAL ( diff --git a/src/test/resources/schema-h2.sql b/src/test/resources/schema-h2.sql index 1f64e59..ab8b713 100644 --- a/src/test/resources/schema-h2.sql +++ b/src/test/resources/schema-h2.sql @@ -1,5 +1,5 @@ CREATE TABLE IF NOT EXISTS ESERVICE ( - eservice_id VARCHAR (50) UNIQUE NOT NULL, + eservice_id VARCHAR (50) NOT NULL, producer_id VARCHAR (50) NOT NULL, descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , @@ -17,21 +17,21 @@ CREATE INDEX IF NOT EXISTS ESERVICE_INDEX_DESCRIPTOR_ID ON ESERVICE USING hash ( CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE ( - eservice_id VARCHAR (50) NOT NULL, - consumer_id VARCHAR (50) NOT NULL, - agreement_id VARCHAR (50) NOT NULL, - descriptor_id VARCHAR (50) NOT NULL, - event_id BIGINT , - state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, - tmst_last_edit TIMESTAMP, - UNIQUE (eservice_id, consumer_id, descriptor_id), - PRIMARY KEY (eservice_id, consumer_id, descriptor_id) -); + agreement_id VARCHAR (50) NOT NULL, + eservice_id VARCHAR (50) NOT NULL, + consumer_id VARCHAR (50) NOT NULL, + descriptor_id VARCHAR (50) NOT NULL, + event_id BIGINT , + state VARCHAR (50) NOT NULL, + tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + tmst_last_edit TIMESTAMP, + PRIMARY KEY (agreement_id) + ); + + /* CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_ID ON CONSUMER_ESERVICE USING hash (eservice_id); CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_CONSUMER_ID ON CONSUMER_ESERVICE USING hash (consumer_id); -CREATE INDEX IF NOT EXISTS CONSUMER_ESERVICE_INDEX_DESCRIPTOR_ID ON CONSUMER_ESERVICE USING hash (descriptor_id); */