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 2c016e1..e7ce328 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 @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS ESERVICE ( descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP NOT NULL, + tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, tmst_last_edit TIMESTAMP, UNIQUE (eservice_id, producer_id, descriptor_id), PRIMARY KEY (eservice_id, producer_id, descriptor_id) @@ -22,7 +22,7 @@ CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE ( descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP 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) diff --git a/src/test/resources/schema-h2.sql b/src/test/resources/schema-h2.sql index 806ac23..1f64e59 100644 --- a/src/test/resources/schema-h2.sql +++ b/src/test/resources/schema-h2.sql @@ -4,7 +4,7 @@ CREATE TABLE IF NOT EXISTS ESERVICE ( descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP NOT NULL, + tmst_insert TIMESTAMP DEFAULT CURRENT_TIMESTAMP, tmst_last_edit TIMESTAMP, UNIQUE (eservice_id, producer_id, descriptor_id), PRIMARY KEY (eservice_id, producer_id, descriptor_id) @@ -23,7 +23,7 @@ CREATE TABLE IF NOT EXISTS CONSUMER_ESERVICE ( descriptor_id VARCHAR (50) NOT NULL, event_id BIGINT , state VARCHAR (50) NOT NULL, - tmst_insert TIMESTAMP 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)