Merge branch 'renovate/flyway' into 'main'
fix(deps): update flyway to v11.14.1 See merge request anthorob/netneutrality!49
This commit is contained in:
commit
aad528c5c7
2 files changed
+7
-4
No files matched your search
@@ -42,7 +42,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.flywaydb</groupId>
|
<groupId>org.flywaydb</groupId>
|
||||||
<artifactId>flyway-maven-plugin</artifactId>
|
<artifactId>flyway-maven-plugin</artifactId>
|
||||||
<version>11.8.2</version>
|
<version>11.14.1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<url>${env.FLYWAY_URL}</url>
|
<url>${env.FLYWAY_URL}</url>
|
||||||
<user>${env.FLYWAY_USER}</user>
|
<user>${env.FLYWAY_USER}</user>
|
||||||
@@ -195,12 +195,12 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.flywaydb</groupId>
|
<groupId>org.flywaydb</groupId>
|
||||||
<artifactId>flyway-core</artifactId>
|
<artifactId>flyway-core</artifactId>
|
||||||
<version>11.8.2</version>
|
<version>11.14.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.flywaydb</groupId>
|
<groupId>org.flywaydb</groupId>
|
||||||
<artifactId>flyway-mysql</artifactId>
|
<artifactId>flyway-mysql</artifactId>
|
||||||
<version>11.8.2</version>
|
<version>11.14.1</version>
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import me.bobert.netneutrality.utils.Settings;
|
|||||||
import org.apache.logging.log4j.LogManager;
|
import org.apache.logging.log4j.LogManager;
|
||||||
import org.apache.logging.log4j.Logger;
|
import org.apache.logging.log4j.Logger;
|
||||||
import org.flywaydb.core.Flyway;
|
import org.flywaydb.core.Flyway;
|
||||||
|
import org.flywaydb.core.api.output.MigrateResult;
|
||||||
|
|
||||||
public class DatabaseMigration {
|
public class DatabaseMigration {
|
||||||
private final static Logger logger = LogManager.getLogger(DatabaseMigration.class);
|
private final static Logger logger = LogManager.getLogger(DatabaseMigration.class);
|
||||||
@@ -21,11 +22,13 @@ public class DatabaseMigration {
|
|||||||
String dbUrl = String.format("jdbc:mysql://%s:3306/%s", dbHost, dbName);
|
String dbUrl = String.format("jdbc:mysql://%s:3306/%s", dbHost, dbName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
logger.info("Running database migrations..");
|
||||||
Flyway flyway = Flyway.configure()
|
Flyway flyway = Flyway.configure()
|
||||||
.dataSource(dbUrl, dbUser, dbPass)
|
.dataSource(dbUrl, dbUser, dbPass)
|
||||||
.load();
|
.load();
|
||||||
|
|
||||||
flyway.migrate();
|
MigrateResult result = flyway.migrate();
|
||||||
|
logger.info("Database migrations finished successfully! (total: {})", result.migrationsExecuted);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error(e);
|
logger.error(e);
|
||||||
System.exit(1);
|
System.exit(1);
|
||||||
|
|||||||
Reference in new issue
Block a user