-
Notifications
You must be signed in to change notification settings - Fork 2
[FIX] 학습 모범 연주 S3 재생 오류 수정 #227
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
Show all changes
8 commits
Select commit
Hold shift + click to select a range
c4037b8
fix: 학습 모범 연주 S3 재생 URL 발급 (#168)
p1001q fbe2d90
test: 학습 모범 연주 S3 재생 테스트 보완 (#168)
p1001q 97aad18
fix: 공용 S3 다운로드 소유자 검증 우회 차단 (#168)
p1001q 8696ee4
refactor: 학습 및 S3 주석을 의도 중심으로 정리 (#168)
p1001q 02c78a5
docs: 학습 모범 연주 Presigned URL 명세 반영 (#168)
p1001q e3589b3
fix: S3 사용자 소유 파일 타입 경계 검증 강화 (#168)
p1001q cfa4024
fix: 모범 연주 Object Key 선행 슬래시 제거 (#168)
p1001q 02690d5
docs: Presigned URL 만료 설명 일반화 (#168)
p1001q 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
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
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
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
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
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
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
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
34 changes: 34 additions & 0 deletions
34
src/main/resources/db/migration/V9__migrate_playing_example_audio_file_url_to_object_key.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,34 @@ | ||
| -- 1. 컬럼명 변경 | ||
| ALTER TABLE playing_example | ||
| RENAME COLUMN audio_file_url TO audio_object_key; | ||
|
|
||
| -- 2. 기존 URL 값에서 S3 Object Key만 추출 | ||
| UPDATE playing_example | ||
| SET audio_object_key = ltrim( | ||
| regexp_replace( | ||
| audio_object_key, | ||
| '^(https?://[^/]+/)?([^?#]*).*$', | ||
| '\2' | ||
| ), | ||
| '/' | ||
| ) | ||
| WHERE audio_object_key IS NOT NULL | ||
| AND btrim(audio_object_key) <> ''; | ||
|
|
||
| -- 3. URL이나 잘못된 prefix가 남아 있으면 마이그레이션을 중단 | ||
| DO $$ | ||
| BEGIN | ||
| IF EXISTS ( | ||
| SELECT 1 | ||
| FROM playing_example | ||
| WHERE audio_object_key IS NULL | ||
| OR btrim(audio_object_key) = '' | ||
| OR audio_object_key LIKE 'http%' | ||
| OR audio_object_key LIKE '%?%' | ||
| OR audio_object_key LIKE '%X-Amz%' | ||
| OR audio_object_key NOT LIKE 'playing_example/%' | ||
| ) THEN | ||
| RAISE EXCEPTION 'playing_example audio_object_key migration validation failed'; | ||
| END IF; | ||
| END | ||
| $$; |
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.
Uh oh!
There was an error while loading. Please reload this page.