这是我的情况。
蟑螂数据库版本= 2.0
飞行通道塞里森= 5.0.7
平台= Docker
我有一个使用flyway管理架构的Java应用程序。
我的配置如下所示:
我的飞行器build.gradle看起来像:
buildscript {
dependencies {
classpath "org.postgresql:postgresql:42.1.4"
}
}
plugins {
id "org.flywaydb.flyway" version "5.0.7"
}
description = "test-app"
flyway {
url = jdbc:postgresql://localhost:26257/test_dev?sslmode=disable
user = root
password =
}
我在本地主机上以不安全模式运行蟑螂v 2.0。
当我跑步时:
gradle flywayClean
我得到
Flyway upgrade recommended: CockroachDB 2.0 is newer than this version of Flyway and support
has not been tested.
Unable to clean unknown schema: "test_dev"
当我跑步时:
gradle flywayMigrate
我得到:
Database: jdbc:postgresql://localhost:26257/test_dev (PostgreSQL 9.5)
Flyway upgrade recommended: CockroachDB 2.0 is newer than this version of Flyway and support has not been tested.
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
Creating schema "test_dev" ...
:test-migrations:flywayMigrate (Thread[Task worker for ':',5,main]) completed. Took 19.995 secs.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':test-migrations:flywayMigrate'.
> Error occurred while executing flywayMigrate
Unable to create schema "test_dev"
--------------------------------------------------
SQL State : 42P04
Error Code : 0
Message : ERROR: database "test_dev" already exists
ERROR: database "test_dev" already exists
我在这里想念什么?
最佳答案
根据文档,仅支持1.1版。
https://flywaydb.org/documentation/database/cockroachdb
Flyway 5.1发行版将支持2.0版。
https://github.com/flyway/flyway/issues/1970