-
Notifications
You must be signed in to change notification settings - Fork 1
[SOU-638] 마이그레이션 파일 다시 생성 #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/main/resources/db/migration/V14__create_fcm_token_tablel.sql
This file contains hidden or 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 fcm_tokens ( | ||
| id BIGSERIAL PRIMARY KEY, | ||
| user_id BIGINT, | ||
| token VARCHAR(255) NOT NULL, | ||
| device_type VARCHAR(20) NOT NULL, | ||
| device_id VARCHAR(100) NOT NULL, | ||
| device_model VARCHAR(100), | ||
| os_version VARCHAR(50), | ||
| app_version VARCHAR(50), | ||
| is_active BOOLEAN DEFAULT true NOT NULL, | ||
| created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
| last_used_at TIMESTAMP | ||
| ); | ||
|
|
||
| -- 인덱스 생성 | ||
| CREATE INDEX idx_fcm_tokens_user_id ON fcm_tokens(user_id) WHERE user_id IS NOT NULL; | ||
| CREATE INDEX idx_fcm_tokens_device_id ON fcm_tokens(device_id); | ||
| CREATE INDEX idx_fcm_tokens_device_type ON fcm_tokens(device_type); | ||
| CREATE INDEX idx_fcm_tokens_is_active ON fcm_tokens(is_active); | ||
| CREATE UNIQUE INDEX idx_fcm_tokens_token ON fcm_tokens(token); | ||
| CREATE UNIQUE INDEX idx_fcm_tokens_user_device ON fcm_tokens(user_id, device_id) | ||
| WHERE user_id IS NOT NULL; | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 변경은 이미 존재하는
V15__create_wishlist_table.sql보다 낮은 버전(V14)을 뒤늦게 추가하므로,application-dev.yaml/application-prod.yaml에out-of-order설정이 없는 현재 Flyway 구성에서는 V15까지 적용된 환경에서 이 스크립트가 ignored(또는 validate 단계에서 실패)되어fcm_tokens테이블이 생성되지 않을 수 있습니다; 그 결과 이후 FCM 토큰 저장 로직이 배포되면 프로덕션에서 테이블 미존재 오류가 발생할 수 있으니, 이 스크립트는 V16+로 재번호해 순차 적용되게 해야 합니다.Useful? React with 👍 / 👎.