【发布时间】:2018-04-12 11:46:36
【问题描述】:
这是我的场景。
- Cockroach DB 版本 = 2.0
- Flyway Ceriosn = 5.0.7
- 平台 = Docker
我有一个 java 应用程序,它使用 flyway 来管理我的模式。
我的配置如下所示: 我的 flyway 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 =
}
我在本地主机上以不安全模式运行 cockroach 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
我会在这里遗漏什么?
【问题讨论】:
-
对蟑螂的支持已被推送并合并到master。如果您从源代码构建,您已经可以拥有它,或者您可以等待 5.1 版本:github.com/flyway/flyway/commit/…
标签: java flyway cockroachdb