Skip to content

Commit 0d42ee1

Browse files
authored
Merge pull request #108 from classic-daramg/fix/flyway-migration-502
[fix] Flyway V9 ๋งˆ์ด๊ทธ๋ ˆ์ด์…˜ ์‹คํŒจ๋กœ ์ธํ•œ 502 ์—๋Ÿฌ ์ˆ˜์ •
2 parents a32ab5a + 3d110f4 commit 0d42ee1

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.daramg.server.common.config;
2+
3+
import org.flywaydb.core.Flyway;
4+
import org.springframework.boot.autoconfigure.flyway.FlywayMigrationStrategy;
5+
import org.springframework.context.annotation.Bean;
6+
import org.springframework.context.annotation.Configuration;
7+
8+
@Configuration
9+
public class FlywayConfig {
10+
11+
@Bean
12+
public FlywayMigrationStrategy flywayMigrationStrategy() {
13+
return flyway -> {
14+
flyway.repair();
15+
flyway.migrate();
16+
};
17+
}
18+
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ALTER TABLE users ADD COLUMN role VARCHAR(20) NOT NULL DEFAULT 'USER';
1+
ALTER TABLE users ADD COLUMN IF NOT EXISTS role VARCHAR(20) NOT NULL DEFAULT 'USER';

0 commit comments

Comments
ย (0)