-
Notifications
You must be signed in to change notification settings - Fork 0
[Feat] #20 트래킹 세션 종료 시 하이킹 기록 생성 #54
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
JangInho
merged 5 commits into
feat/#19-tracking-gps
from
feat/#20-tracking-record-finalize
May 21, 2026
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
d3ce2f1
chore: HikingRecord 확장 및 마이그레이션 추가
JangInho 7a65656
feat: 트래킹 세션 종료 시 HikingRecord 자동 생성
JangInho 43242da
Merge pull request #73 from SEMOSAN/feat/#19-tracking-gps
JangInho b412b69
Merge remote-tracking branch 'origin/develop' into feat/#20-tracking-…
JangInho 2dd76e2
refactor: HikingRecord 확장 마이그레이션 V9 + 리뷰 반영
JangInho 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
41 changes: 41 additions & 0 deletions
41
src/main/resources/db/migration/V9__extend_hiking_record.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,41 @@ | ||
| -- ===================================================================== | ||
| -- V9__extend_hiking_record.sql | ||
| -- 목적: 트래킹 흐름에서 생성될 HikingRecord 확장. | ||
| -- - 트래킹 세션 참조 (tracking_session_id, UNIQUE — 세션당 기록 1건 강제) | ||
| -- - 시간 정보 (started_at, ended_at, paused_seconds_total) | ||
| -- - GPS 통계 (distance, ascent, descent) | ||
| -- - 자유 기록 대응 (course_id NOT NULL → NULLABLE) | ||
| -- ===================================================================== | ||
|
|
||
| -- 1) course_id 를 nullable 로 (자유 기록 대응) | ||
| ALTER TABLE hiking_records | ||
| ALTER COLUMN course_id DROP NOT NULL; | ||
|
|
||
| -- 2) 트래킹 세션 참조 | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS tracking_session_id bigint; | ||
|
|
||
| -- 3) 시간 정보 | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS started_at timestamp(6); | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS ended_at timestamp(6); | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS paused_seconds_total integer not null default 0; | ||
|
|
||
| -- 4) GPS 통계 | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS distance double precision; | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS ascent double precision; | ||
| ALTER TABLE hiking_records | ||
| ADD COLUMN IF NOT EXISTS descent double precision; | ||
|
|
||
| -- 5) FK + UNIQUE 제약 (NULL 은 표준 UNIQUE 검사에서 제외돼 수동 기록은 영향 없음) | ||
| ALTER TABLE hiking_records | ||
| ADD CONSTRAINT fk_hiking_records_tracking_session | ||
| FOREIGN KEY (tracking_session_id) REFERENCES tracking_sessions(id); | ||
|
|
||
| ALTER TABLE hiking_records | ||
| ADD CONSTRAINT uk_hiking_records_tracking_session | ||
| UNIQUE (tracking_session_id); |
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.
stats의 pointCount가 0이면 통계 데이터 없음으로 간주하고 경고 처리나 예외 처리하면 좋을 듯!
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.
좋습니다 일단 예외는 안넣고 로그만 넣었습니다