-
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.
[TRAC - 13] - Implement Flyway and add DDL(V1, V2) (#9)
- Loading branch information
1 parent
d6ef3c0
commit c3cbc9d
Showing
5 changed files
with
34 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
CREATE TABLE users | ||
( | ||
id BIGSERIAL PRIMARY KEY, | ||
chat_id BIGINT NOT NULL, | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
created_by VARCHAR(255), | ||
updated_by VARCHAR(255) | ||
); |
14 changes: 14 additions & 0 deletions
14
src/main/resources/db.migration/V2__monitoring-table-creating.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,14 @@ | ||
CREATE TABLE monitorings | ||
( | ||
id BIGSERIAL PRIMARY KEY, | ||
ticker VARCHAR(100) NOT NULL, | ||
target_price DECIMAL(18, 2) NOT NULL, | ||
user_id BIGINT NOT NULL, | ||
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
created_by VARCHAR(255), | ||
updated_by VARCHAR(255), | ||
CONSTRAINT fk_monitorings_users FOREIGN KEY (user_id) REFERENCES users (id) | ||
ON DELETE CASCADE | ||
ON UPDATE CASCADE | ||
); |