Skip to content

Commit

Permalink
Set default timestamp for tmst_insert column
Browse files Browse the repository at this point in the history
  • Loading branch information
CriMDev97 committed Nov 2, 2023
1 parent 2cc8c47 commit c488496
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/schema-h2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit c488496

Please sign in to comment.