setup flyway with separate postgres for history info
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package com.stktrk.app.db.migrations;
|
||||
|
||||
import org.flywaydb.core.api.migration.BaseJavaMigration;
|
||||
import org.flywaydb.core.api.migration.Context;
|
||||
|
||||
import java.sql.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class V1__CreateTest extends BaseJavaMigration {
|
||||
public void migrate(Context context) throws Exception {
|
||||
|
||||
Class.forName("org.postgresql.Driver");
|
||||
|
||||
Properties props = new Properties();
|
||||
props.setProperty("user", "root");
|
||||
props.setProperty("password", "playwithdata");
|
||||
props.setProperty("ssl", "false");
|
||||
props.setProperty("sslmode", "disable");
|
||||
|
||||
System.out.println ("migration");
|
||||
|
||||
|
||||
try (Connection connection = DriverManager.getConnection("jdbc:postgresql://192.168.178.50:5432/graph", props)) {
|
||||
|
||||
Statement st = connection.createStatement();
|
||||
st.execute("CREATE VERTEX TYPE test");
|
||||
|
||||
connection.close();
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
System.out.println (e);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,7 @@
|
||||
spring.application.name=app
|
||||
server.port=9090
|
||||
springdoc.swagger-ui.path=/swagger-ui.html
|
||||
springdoc.swagger-ui.path=/swagger-ui.html
|
||||
|
||||
flyway.user=flyway_user
|
||||
flyway.password=7e7v55UcYGrY0e3UPYI0qtyMA4YJ1ZkTEaoyZ252GluFkiEMHVT9U5ULS7Rg2rGi
|
||||
flyway.schemas=flyway_db
|
||||
Reference in New Issue
Block a user