Skip to content

Conversation

@nayonsoso
Copy link
Collaborator

@nayonsoso nayonsoso commented Jun 25, 2025

파일 이름이 V13_xxxx 로 되어있던 것을 V13__xxxx 로 수정합니다.
(flyway 스크립트 이름 컨벤션을 따르지 않으면 해당 스크립트 스킵하므로!)

@nayonsoso nayonsoso added the 버그 Something isn't working label Jun 25, 2025
Copy link
Contributor

@Gyuhyeok99 Gyuhyeok99 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다!

@coderabbitai
Copy link

coderabbitai bot commented Jun 25, 2025

Walkthrough

  1. 기존 인덱스 컬럼명 변경
    • application 테이블의 인덱스 정의에서 기존에 사용하던 first_choice_university_apply_info_id, second_choice_university_apply_info_id, third_choice_university_apply_info_id 컬럼명이 각각 first_choice_university_info_for_apply_id, second_choice_university_info_for_apply_id, third_choice_university_info_for_apply_id로 변경되었습니다.
  2. 나머지 인덱스 컬럼은 그대로 유지
    • 변경된 컬럼을 제외한 나머지 인덱스 컬럼들은 기존과 동일하게 유지되었습니다.
  3. 매핑 관련 변경 사항 없음
    • many-to-one 매핑 삭제 등과 관련된 추가적인 엔터티 선언 변경은 발생하지 않았습니다.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🔭 Outside diff range comments (1)
src/main/resources/db/migration/V13__add_application_index_and_delete_manny_to_one_mapping.sql (1)

5-7: 기존 동일 명칭 인덱스 충돌 가능성

  1. idx_app_user_term_delete 인덱스가 이미 존재하면 CREATE INDEX 가 실패합니다.
    • CREATE INDEX IF NOT EXISTS … 로 바꾸거나,
    • 혹은 DROP INDEX IF EXISTS … 후 재생성을 권장합니다.
-DROP INDEX IF EXISTS idx_app_user_term_delete; -- 필요 시 선행
-CREATE INDEX idx_app_user_term_delete
-    ON application(site_user_id, term, is_delete);
+CREATE INDEX IF NOT EXISTS idx_app_user_term_delete
+    ON application(site_user_id, term, is_delete);
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e086e8c and 22037f8.

📒 Files selected for processing (1)
  • src/main/resources/db/migration/V13__add_application_index_and_delete_manny_to_one_mapping.sql (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: build
🔇 Additional comments (1)
src/main/resources/db/migration/V13__add_application_index_and_delete_manny_to_one_mapping.sql (1)

1-3: 컬럼명 RENAME 시 FK·트리거 의존성 확인 필요

  1. 외래키·트리거·VIEW가 해당 컬럼을 참조하고 있다면 ALTER TABLE … RENAME COLUMN 단계에서 에러가 납니다.
    • 사전에 DROP CONSTRAINT … 또는 ALTER CONSTRAINT … 패턴을 넣어 두었는지 재확인해 주세요.
  2. Flyway 롤백 플랜이 없다면 Down 마이그레이션 작성도 검토해 주세요.

Comment on lines 8 to +15
CREATE INDEX idx_app_first_choice_search
ON application(verify_status, term, is_delete, first_choice_university_apply_info_id);
ON application(verify_status, term, is_delete, first_choice_university_info_for_apply_id);

CREATE INDEX idx_app_second_choice_search
ON application(verify_status, term, is_delete, second_choice_university_apply_info_id);
ON application(verify_status, term, is_delete, second_choice_university_info_for_apply_id);

CREATE INDEX idx_app_third_choice_search
ON application(verify_status, term, is_delete, third_choice_university_apply_info_id);
ON application(verify_status, term, is_delete, third_choice_university_info_for_apply_id);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

중복 인덱스 + 자동 컬럼 추적 오해

  1. 컬럼 RENAME 시 기존 인덱스는 내부적으로 새 컬럼명을 자동 추적합니다. 따라서 동일 이름으로 다시 CREATE INDEX 하면 충돌이 납니다.
  2. 해결 옵션
    기존 인덱스 재사용 → 본 구문(8–15라인) 자체를 제거.
    재생성 필요DROP INDEX IF EXISTSCREATE INDEX 실행.
  3. CONCURRENTLY 옵션을 사용하면 운영 중 락을 최소화할 수 있습니다(PostgreSQL 기준).
-DROP INDEX IF EXISTS idx_app_first_choice_search;
-DROP INDEX IF EXISTS idx_app_second_choice_search;
-DROP INDEX IF EXISTS idx_app_third_choice_search;
-
-CREATE INDEX idx_app_first_choice_search
-    ON application(verify_status, term, is_delete, first_choice_university_info_for_apply_id);
-CREATE INDEX idx_app_second_choice_search
-    ON application(verify_status, term, is_delete, second_choice_university_info_for_apply_id);
-CREATE INDEX idx_app_third_choice_search
-    ON application(verify_status, term, is_delete, third_choice_university_info_for_apply_id);
+-- 기존 인덱스 제거 후 재생성(필요 시 CONCURRENTLY 사용)
+DROP INDEX IF EXISTS idx_app_first_choice_search;
+CREATE INDEX idx_app_first_choice_search
+    ON application(verify_status, term, is_delete, first_choice_university_info_for_apply_id);
+
+DROP INDEX IF EXISTS idx_app_second_choice_search;
+CREATE INDEX idx_app_second_choice_search
+    ON application(verify_status, term, is_delete, second_choice_university_info_for_apply_id);
+
+DROP INDEX IF EXISTS idx_app_third_choice_search;
+CREATE INDEX idx_app_third_choice_search
+    ON application(verify_status, term, is_delete, third_choice_university_info_for_apply_id);

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In
src/main/resources/db/migration/V13__add_application_index_and_delete_manny_to_one_mapping.sql
lines 8 to 15, the script attempts to create indexes that likely already exist
due to column renaming automatically updating index definitions, causing
conflicts. To fix this, either remove these CREATE INDEX statements entirely to
reuse existing indexes or modify the script to first drop the indexes if they
exist using DROP INDEX IF EXISTS, then recreate them with CREATE INDEX
CONCURRENTLY to minimize locking during operation.

@nayonsoso nayonsoso merged commit 45430c9 into develop Jun 25, 2025
2 checks passed
@nayonsoso nayonsoso deleted the chore/fix-flyway-13-typo branch June 25, 2025 04:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

버그 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants