-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(rent-service): use flyway as db migration tool
- Loading branch information
vincenzo.corso
committed
Mar 24, 2024
1 parent
7e0b9b2
commit 691e55d
Showing
8 changed files
with
32 additions
and
4 deletions.
There are no files selected for viewing
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
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
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
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
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
7 changes: 7 additions & 0 deletions
7
rent-service/src/main/resources/db/migration/postgres/V1__CREATE_OUTBOX_TABLE.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,7 @@ | ||
CREATE TABLE IF NOT EXISTS outbox ( | ||
message_id text primary key, | ||
channel text not null, | ||
message_key text not null, | ||
payload text not null, | ||
headers text not null | ||
); |
7 changes: 7 additions & 0 deletions
7
rent-service/src/main/resources/db/migration/postgres/V2__CREATE_RENT_TABLE.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,7 @@ | ||
CREATE TABLE IF NOT EXISTS rents ( | ||
rent_id uuid primary key, | ||
version bigint not null, | ||
customer_id text not null, | ||
vehicle_id text not null, | ||
current_state text not null | ||
); |
8 changes: 8 additions & 0 deletions
8
...rvice/src/main/resources/db/migration/postgres/V3__CREATE_RENT_STATE_TRANSITION_TABLE.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,8 @@ | ||
CREATE TABLE IF NOT EXISTS rent_state_transitions ( | ||
rent UUID, | ||
sequence_number SMALLINT, | ||
timestamp TIMESTAMP WITHOUT TIME ZONE NOT NULL, | ||
state TEXT NOT NULL, | ||
PRIMARY KEY (rent, sequence_number), | ||
FOREIGN KEY (rent) REFERENCES rents(rent_id) | ||
); |