Conversation
- V1: 베이스라인 스키마 정의 - V2: PK/FK 타입 정렬 (int → bigint) - V3: varchar → enum 타입 변환 - V4: 제약조건 및 기본값 추가 - 검증 SQL 및 마이그레이션 가이드 문서 추가
V1에 이미 college.name의 UNIQUE 제약조건이 존재하므로 V4에서 중복 추가하는 부분 제거
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
feat: DB 마이그레이션 스크립트 추가
Summary of ChangesHello @eunseo9311, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! 이 PR은 데이터베이스 스키마 변경 관리를 자동화하기 위해 Flyway를 도입하고, 기존 스키마의 여러 문제점을 개선하는 데 중점을 둡니다. PK/FK 타입 통일, Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. DB 스키마, Flyway로 정돈하니, 타입 맞추고 Enum 변환, 데이터 무결성, 이제 안심. 코드 리뷰, 모두가 웃음꽃 피네. Footnotes
|
There was a problem hiding this comment.
Code Review
이 PR은 Flyway를 도입하여 데이터베이스 마이그레이션을 자동화하고, 관련 스크립트와 상세한 가이드를 추가하여 스키마 변경 관리를 체계적으로 개선했습니다. 전반적으로 완성도가 높지만, run_validation.sh 스크립트에서 데이터베이스 비밀번호가 명령줄 인수로 전달되어 시스템의 다른 사용자에게 노출될 수 있는 보안 취약점이 발견되었습니다. 이 외에도 보안 및 코드 명확성 개선을 위한 몇 가지 제안 사항이 있습니다.
|
|
||
| # 검증 쿼리 실행 | ||
| RESULT_FILE="validation_result_${ENV}_$(date +%Y%m%d_%H%M%S).txt" | ||
| mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" < validate_enum_data.sql > "$RESULT_FILE" 2>&1 |
There was a problem hiding this comment.
The script passes the database password directly to the mysql command using the -p flag. This makes the password visible in the system's process list (e.g., via ps aux) to any other user on the same machine, as the mysql client itself warns: [Warning] Using a password on the command line interface can be insecure. It is recommended to use the MYSQL_PWD environment variable to pass the password, which is a more secure approach to prevent exposure in process lists or shell history.
| mysql -h "$DB_HOST" -u "$DB_USER" -p"$DB_PASS" "$DB_NAME" < validate_enum_data.sql > "$RESULT_FILE" 2>&1 | |
| # Use MYSQL_PWD environment variable to avoid exposing password in process list | |
| export MYSQL_PWD="$DB_PASS" | |
| mysql -h "$DB_HOST" -u "$DB_USER" "$DB_NAME" < validate_enum_data.sql > "$RESULT_FILE" 2>&1 | |
| unset MYSQL_PWD |
| # AWS RDS 스냅샷으로 복원 | ||
| aws rds restore-db-instance-from-db-snapshot \ | ||
| --db-instance-identifier your-db-restored \ | ||
| --db-snapshot-identifier eatssu-dev-pre-migration-20260207 |
There was a problem hiding this comment.
롤백 명령어 예시에 포함된 스냅샷 식별자(eatssu-dev-pre-migration-20260207)에 미래 날짜가 사용되었습니다. 이는 예시일 수 있으나, 실제 실행 시 혼동을 주거나 복사-붙여넣기 오류를 유발할 수 있습니다. your-snapshot-identifier와 같이 더 일반적인 플레이스홀더로 변경하는 것을 제안합니다.
| --db-snapshot-identifier eatssu-dev-pre-migration-20260207 | |
| --db-snapshot-identifier your-snapshot-identifier |
| -- 1. FK 제약조건 해제 | ||
| -- 2. PK 타입 변경 | ||
| -- 3. FK 컬럼 타입 변경 | ||
| -- 4. FK 제약조건 재생성 |
#️⃣ Issue Number
#344
📝 요약(Summary)
💬 공유사항 to 리뷰어
Test
✅ PR Checklist
PR이 다음 요구 사항을 충족하는지 확인하세요.