forked from eclipse-tractusx/bpdm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bridge): Add Flyway migration for SyncRecord
- Loading branch information
1 parent
859cb2b
commit 122e462
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
bpdm-bridge-dummy/src/main/resources/db/migration/V4_0_0_0__create_sequence.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
CREATE SEQUENCE IF NOT EXISTS bpdm_sequence START WITH 1 INCREMENT BY 1; |
23 changes: 23 additions & 0 deletions
23
bpdm-bridge-dummy/src/main/resources/db/migration/V4_0_0_1__create_sync_records.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CREATE TABLE sync_records | ||
( | ||
id BIGINT NOT NULL, | ||
uuid UUID NOT NULL, | ||
created_at TIMESTAMP with time zone NOT NULL, | ||
updated_at TIMESTAMP with time zone NOT NULL, | ||
type VARCHAR(255) NOT NULL, | ||
status VARCHAR(255) NOT NULL, | ||
progress FLOAT NOT NULL, | ||
count INTEGER NOT NULL, | ||
status_details VARCHAR(255), | ||
save_state VARCHAR(255), | ||
started_at TIMESTAMP with time zone, | ||
finished_at TIMESTAMP with time zone, | ||
from_time TIMESTAMP with time zone, | ||
CONSTRAINT pk_sync_records PRIMARY KEY (id) | ||
); | ||
|
||
ALTER TABLE sync_records | ||
ADD CONSTRAINT uc_sync_records_type UNIQUE (type); | ||
|
||
ALTER TABLE sync_records | ||
ADD CONSTRAINT uc_sync_records_uuid UNIQUE (uuid); |