Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 0 additions & 24 deletions src/main/java/eatda/controller/article/ArticleController.java

This file was deleted.

9 changes: 0 additions & 9 deletions src/main/java/eatda/controller/article/ArticleResponse.java

This file was deleted.

8 changes: 0 additions & 8 deletions src/main/java/eatda/controller/article/ArticlesResponse.java

This file was deleted.

46 changes: 0 additions & 46 deletions src/main/java/eatda/domain/article/Article.java

This file was deleted.

2 changes: 1 addition & 1 deletion src/main/java/eatda/domain/story/Story.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class Story extends AuditingEntity {
@Column(name = "store_category", nullable = false)
private StoreCategory storeCategory;

@Column(name = "description", nullable = false)
@Column(name = "description")
private String description;

@NotNull
Expand Down
12 changes: 0 additions & 12 deletions src/main/java/eatda/repository/article/ArticleRepository.java

This file was deleted.

33 changes: 0 additions & 33 deletions src/main/java/eatda/service/article/ArticleService.java

This file was deleted.

11 changes: 0 additions & 11 deletions src/main/resources/db/migration/V1__init.sql
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,3 @@ CREATE TABLE `cheer`
FOREIGN KEY (`member_id`) REFERENCES `member` (`id`) ON DELETE CASCADE,
FOREIGN KEY (`store_id`) REFERENCES `store` (`id`) ON DELETE CASCADE
);

CREATE TABLE `article`
(
`id` BIGINT NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL,
`subtitle` VARCHAR(255) NOT NULL,
`article_url` VARCHAR(511) NOT NULL,
`image_key` VARCHAR(511) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
);
2 changes: 1 addition & 1 deletion src/main/resources/db/migration/V3__add_story_table.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ CREATE TABLE `story`
`store_road_address` VARCHAR(255) NOT NULL,
`store_lot_number_address` VARCHAR(255) NOT NULL,
`store_category` VARCHAR(50) NOT NULL,
`description` TEXT NOT NULL,
`description` TEXT NULL,
Copy link

@coderabbitai coderabbitai bot Aug 11, 2025

Choose a reason for hiding this comment

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

💡 Verification agent

🧩 Analysis chain

Flyway 기존 마이그레이션(V3) 파일 수정은 체크섬 불일치/이행 실패를 유발할 수 있습니다

이미 로컬/CI 등에서 V3가 적용된 상태라면, V3 내용 변경으로 Flyway 체크섬 불일치가 발생합니다. 또한 V5(ALTER) 파일을 삭제한 상태이므로, DB를 초기화하지 않으면 마이그레이션 경로가 깨질 수 있습니다. PR 설명대로 전 환경에서 DB 초기화를 확실히 수행한다면 가능하지만, 히스토리 재작성은 팀/CI 동기화가 실패할 때 리스크가 큽니다.

권장: V3는 원본대로 유지하고, 새로운 마이그레이션(V6 등)으로 NULL 허용 변경을 적용하세요. 이렇게 하면 초기화가 불필요하고, 안전하게 점진적 이행이 가능합니다.

옵션 A(권장) — V3 원복 + 신규 V6 추가

  • V3 원복(diff 제안):
-    `description`              TEXT NULL,
+    `description`              TEXT NOT NULL,
  • 신규 파일 예: src/main/resources/db/migration/V6__story_description_nullable.sql
ALTER TABLE `story`
  MODIFY COLUMN `description` TEXT NULL;

옵션 B(현 상태 유지) — 전 환경 DB 초기화 강제

  • 모든 로컬/CI/스테이징 환경에서 flyway clean 또는 DB drop 후 재생성 필요
  • 머지/배포 체크리스트에 “DB 초기화 완료”를 명시하고, 실패 시 롤백 플랜 포함

검증 스크립트(레포 루트에서 실행): 현 레포 상태와 Flyway 설정을 빠르게 점검합니다.


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "== Migration files =="
fd -a 'V*_*.sql' src/main/resources/db/migration || true

echo
echo "== Check if V5 (story_description_available_null) exists =="
fd -a 'V5__*story*' src/main/resources/db/migration || true

echo
echo "== Flyway config candidates =="
fd -a 'application*.yml' || true
fd -a 'application*.properties' || true

echo
echo "== Inspect Flyway flags (cleanDisabled/baselineOnMigrate/locations) =="
rg -n 'flyway\.(cleanDisabled|baselineOnMigrate|locations)' || true

Length of output: 1354


Flyway 마이그레이션 히스토리 재작성 위험 — V3 복원 후 신규 마이그레이션 생성 권장

현재 src/main/resources/db/migration 에는 V1, V3만 존재하며, V5 파일은 삭제된 상태입니다. 또한 application.yml에 별도 Flyway 설정(cleanDisabled, baselineOnMigrate 등)이 없어 기본 동작으로 마이그레이션을 수행하므로, V3 마이그레이션을 직접 수정할 경우 이미 해당 스크립트가 적용된 환경에서 체크섬 불일치로 마이그레이션 실패가 발생할 수 있습니다.

권장 해결안:

  • V3 마이그레이션 원본으로 복원
    파일: src/main/resources/db/migration/V3__add_story_table.sql (10행)
    @@ -7,7 +7,7 @@ CREATE TABLE `story` (
    -    `description`              TEXT NULL,
    +    `description`              TEXT NOT NULL,
  • 새로운 마이그레이션(V4 이상) 생성
    예: src/main/resources/db/migration/V4__story_description_nullable.sql
    ALTER TABLE `story`
      MODIFY COLUMN `description` TEXT NULL;

대안(위험도 높음):
모든 로컬/CI/스테이징 환경에 대해 flyway clean 또는 DB drop → 재생성을 반드시 수행하도록 강제하고, “DB 초기화 완료”를 머지/배포 체크리스트에 명시해야 합니다.

🤖 Prompt for AI Agents
In src/main/resources/db/migration/V3__add_story_table.sql around line 10, the
migration has been edited to change `description` to TEXT NULL which risks
Flyway checksum mismatches in environments where V3 already ran; restore V3 to
its original committed content, then create a new migration file (e.g.,
src/main/resources/db/migration/V4__story_description_nullable.sql) containing
an ALTER TABLE statement to MODIFY COLUMN `description` TEXT NULL so the change
is applied as a new migration; do not modify V3 in-place unless you will enforce
a full Flyway clean/database reset across all environments.

Copy link
Member Author

Choose a reason for hiding this comment

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

  • PR 머지하고 배포하기 전에 DB 테이블을 초기화할 예정
  • 만약 팀원이 DB 초기화를 반대할 경우, 해당 부분 롤백하고 다시 SQL 문을 추가할 예정

Copy link

Choose a reason for hiding this comment

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

@leegwichan 네, 이해했습니다. DB 초기화 계획과 롤백 대안을 준비하신 점 확인했습니다.

현재 접근 방식으로 진행하실 경우 체크리스트:

  • 머지 전 팀원들과 DB 초기화 일정 사전 공유
  • 로컬/CI 환경에서 flyway clean 또는 스키마 재생성 필요
  • 초기화 시점에 flyway_schema_history 테이블도 함께 제거 확인

팀원 반대 시 롤백 플랜도 명확하니 안전하게 진행 가능할 것 같습니다.


✏️ Learnings added
Learnt from: leegwichan
PR: YAPP-Github/26th-Web-Team-1-BE#153
File: src/main/resources/db/migration/V3__add_story_table.sql:10-10
Timestamp: 2025-08-11T07:48:37.790Z
Learning: leegwichan 팀은 프로덕션 운영 시작 전 환경에서는 Flyway 마이그레이션 파일을 직접 수정하는 것을 허용하며, DB 초기화를 통해 해결하는 방식을 선호합니다. 다만 팀원 합의가 필요한 경우 롤백하고 새 마이그레이션 파일을 추가하는 대안도 고려합니다.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.

`image_key` VARCHAR(511) NOT NULL,
`created_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`)
Expand Down

This file was deleted.

7 changes: 0 additions & 7 deletions src/main/resources/db/seed/dev/V2__dev_init_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,3 @@ VALUES (1, 1, 1, '정말 맛있어요! 강추합니다!', 'cheer/dummy/1.jpg', t
(5, 5, 5, '디저트가 정말 맛있어요!', 'cheer/dummy/5.jpg', true),
(6, 6, 6, '커피가 정말 맛있어요!', 'cheer/dummy/6.jpg', false),
(7, 7, 7, '패스트푸드가 빠르고 맛있어요!', 'cheer/dummy/7.jpg', false);

INSERT INTO article (id, title, subtitle, article_url, image_key)
VALUES (1, '미식가를 위한 수제 아이스크림 가게 🍨', '센프란시스코에서 영감을 얻은 펠엔콜 사장님의 이야기',
'https://ultra-wallet-037.notion.site/240b6292d5398127a630fabaa9dcd80d?pvs=74',
'article/dummy/1.jpg'),
(2, '두 번째 기사', '서브타이틀 2', 'https://example.com/article2', 'article/dummy/2.jpg'),
(3, '세 번째 기사', '서브타이틀 3', 'https://example.com/article3', 'article/dummy/3.jpg');
5 changes: 0 additions & 5 deletions src/main/resources/db/seed/local/V2__local_init_data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,3 @@ VALUES (1, 1, 1, '정말 맛있어요! 강추합니다!', 'cheer/dummy/1.jpg', t
(5, 5, 5, '디저트가 정말 맛있어요!', 'cheer/dummy/5.jpg', true),
(6, 6, 6, '커피가 정말 맛있어요!', 'cheer/dummy/6.jpg', false),
(7, 7, 7, '패스트푸드가 빠르고 맛있어요!', 'cheer/dummy/7.jpg', false);

INSERT INTO article (id, title, subtitle, article_url, image_key)
VALUES (1, '첫 번째 기사', '서브타이틀 1', 'https://example.com/article1', 'article/dummy/1.jpg'),
(2, '두 번째 기사', '서브타이틀 2', 'https://example.com/article2', 'article/dummy/2.jpg'),
(3, '세 번째 기사', '서브타이틀 3', 'https://example.com/article3', 'article/dummy/3.jpg');
9 changes: 0 additions & 9 deletions src/test/java/eatda/controller/BaseControllerTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
import eatda.controller.web.jwt.JwtManager;
import eatda.domain.ImageKey;
import eatda.domain.member.Member;
import eatda.fixture.ArticleGenerator;
import eatda.fixture.CheerGenerator;
import eatda.fixture.MemberGenerator;
import eatda.fixture.StoreGenerator;
import eatda.fixture.StoryGenerator;
import eatda.repository.article.ArticleRepository;
import eatda.repository.cheer.CheerRepository;
import eatda.repository.member.MemberRepository;
import eatda.repository.store.StoreRepository;
Expand Down Expand Up @@ -52,7 +50,6 @@ public class BaseControllerTest {
private static final ImageKey MOCKED_IMAGE_KEY = new ImageKey("mocked-image-path");
private static final String MOCKED_IMAGE_URL = "https://example.com/image.jpg";


@Autowired
protected MemberGenerator memberGenerator;

Expand All @@ -62,9 +59,6 @@ public class BaseControllerTest {
@Autowired
protected CheerGenerator cheerGenerator;

@Autowired
protected ArticleGenerator articleGenerator;

@Autowired
protected StoryGenerator storyGenerator;

Expand All @@ -77,9 +71,6 @@ public class BaseControllerTest {
@Autowired
protected CheerRepository cheerRepository;

@Autowired
protected ArticleRepository articleRepository;

@Autowired
protected StoryRepository storyRepository;

Expand Down
32 changes: 0 additions & 32 deletions src/test/java/eatda/controller/article/ArticleControllerTest.java

This file was deleted.

4 changes: 0 additions & 4 deletions src/test/java/eatda/document/BaseDocumentTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import eatda.controller.web.jwt.JwtManager;
import eatda.exception.BusinessErrorCode;
import eatda.exception.EtcErrorCode;
import eatda.service.article.ArticleService;
import eatda.service.auth.AuthService;
import eatda.service.auth.OauthService;
import eatda.service.cheer.CheerService;
Expand Down Expand Up @@ -64,9 +63,6 @@ public abstract class BaseDocumentTest {
@MockitoBean
protected CheerService cheerService;

@MockitoBean
protected ArticleService articleService;

@MockitoBean
protected ImageService imageService;

Expand Down
76 changes: 0 additions & 76 deletions src/test/java/eatda/document/article/ArticleDocumentTest.java

This file was deleted.

Loading