Skip to content
Open
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
6 changes: 3 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>10.16.0</version>
<version>11.10.3</version>
</dependency>

<dependency>
Expand All @@ -31,13 +31,13 @@
<dependency>
<groupId>com.yugabyte</groupId>
<artifactId>jdbc-yugabytedb</artifactId>
<version>42.3.5-yb-4</version>
<version>42.7.3-yb-4</version>
</dependency>

<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-database-yugabytedb</artifactId>
<version>10.16.1</version>
<version>10.21.0</version>
</dependency>

<dependency>
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/yugabyte/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ public class Utils {
static String path = System.getenv("YBDB_PATH");

protected static void startYBDBCluster() {
System.out.println("Starting YugabyteDB cluster...");
if (path == null || path.trim().isEmpty()) {
throw new IllegalArgumentException("No valid path available for YBDB_PATH: " + path);
}
Expand All @@ -14,6 +15,7 @@ protected static void startYBDBCluster() {
}

protected static void stopYBDBCluster() {
System.out.println("Stopping YugabyteDB cluster...");
executeCmd(path + "/bin/yb-ctl destroy", "Stop YugabyteDB cluster", 10);
}

Expand Down
9 changes: 9 additions & 0 deletions src/test/java/com/yugabyte/TestBaseline.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,17 @@ public void baselineTest() throws SQLException {
TestYBLocking.checkMigrations(conn, 1);
}

public static void createOldLockTable(Connection conn) throws SQLException {
Statement stmt = conn.createStatement();
stmt.execute("DROP TABLE IF EXISTS YB_FLYWAY_LOCK_TABLE");
System.out.println("Deleted YB_FLYWAY_LOCK_TABLE table");
stmt.execute("CREATE TABLE YB_FLYWAY_LOCK_TABLE (table_name varchar PRIMARY KEY, locked bool)");
System.out.println("Created YB_FLYWAY_LOCK_TABLE table with old schema");
}

@Test
public void dlabsTest() throws SQLException {
createOldLockTable(conn);
Flyway flyway = Flyway.configure()
.locations("filesystem:src/test/resources/dlabs-schema")
.dataSource(url, "yugabyte", "yugabyte")
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/com/yugabyte/TestYBLocking.java
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,9 @@ private void migrationOperation() {
if (ex.getCause() instanceof SQLException
&& "40001".equals(((SQLException) ex.getCause()).getSQLState())) {
// possible, so ignore.
System.out.println("FlywayException during migration: SQLState 40001. This is possible in concurrent migration.");
System.out.println("[" + Thread.currentThread().getName() + "] FlywayException during migration: SQLState 40001. This is possible in concurrent migration.");
} else {
System.out.println("FlywayException in thread: " + ex);
System.out.println("[" + Thread.currentThread().getName() + "] FlywayException in thread: " + ex);
errors.put(Thread.currentThread().getName(), ex);
}
}
Expand Down
1 change: 1 addition & 0 deletions src/test/resources/logback.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
</encoder>
</appender>

<logger name="org.flywaydb.community.database.postgresql.yugabytedb" level="TRACE"/>
<root level="info">
<appender-ref ref="STDOUT" />
</root>
Expand Down