Skip to content

Commit 6b5f6dd

Browse files
committed
fix: UserPotSeeder seed() 실행 시 8종 씨앗 plant_collection INSERT IGNORE 누락 보완
1 parent d208b8c commit 6b5f6dd

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/main/java/com/Rootin/global/config/seeder/UserPotSeeder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,14 @@ public Optional<SeedContext> seed() {
8282
.findFirstByNameAndGradeAndGrowthStage("흑장미씨앗", Grade.RARE, GrowthStage.SEED)
8383
.orElseThrow(() -> new IllegalStateException("식물 마스터 데이터 누락: 흑장미씨앗 (RARE/SEED). PlantMasterSeeder가 먼저 실행되었는지 확인하세요."));
8484

85+
// ── plant_collection: 8종 씨앗 전부 해금 ────────────────────────────────
86+
for (Plant seed : new Plant[]{seedPlant, moonPlant, shroomPlant, cactusPlant,
87+
boltPlant, firePlant, icePlant, rosePlant}) {
88+
jdbcTemplate.update(
89+
"INSERT IGNORE INTO plant_collection (user_id, plant_id, created_at) VALUES (?, ?, NOW())",
90+
user.getId(), seed.getId());
91+
}
92+
8593
// ── 화분 생성 ──────────────────────────────────────────────────────────
8694
Pot codingPot = potRepository.save(Pot.builder()
8795
.userId(user.getId()).title("코딩").description("매일 한 가지씩 배우는 코딩 기록")

0 commit comments

Comments
 (0)