我第一次测试 Flyway,版本 2.1.1。我正在使用 Ant 任务,如果该表尚不存在(并且它在我的模式中不存在),则该任务migrate
应创建该表,并且出现此错误:schema_version
C:\Users\dmusiani\Desktop\flyaway-test>ant
Buildfile: build.xml
migrate-db:
[flyway:migrate] com.googlecode.flyway.core.api.FlywayException: Found non-empty
schema "SYSTEM" without metadata table! Use init() first to initialize the meta
data table.
BUILD FAILED
C:\Users\dmusiani\Desktop\flyaway-test\build.xml:37: Flyway Error: com.googlecod
e.flyway.core.api.FlywayException: Found non-empty schema "SYSTEM" without metad
ata table! Use init() first to initialize the metadata table.
Total time: 0 seconds
C:\Users\dmusiani\Desktop\flyaway-test>
我尝试init
在迁移之前添加,第一次一切正常,但是当我第二次启动构建时,我从init
sayng 中得到一个错误,表已经存在。
这是我的 Ant 目标:
<target name="migrate-db">
<path id="flyway.lib.path">
<fileset dir="./lib">
<include name="**/flyway*.jar"/>
</fileset>
</path>
<path id="flyway.classpath">
<fileset dir="./lib" includes="ojdbc6-11.2.0.3.jar"/>
</path>
<taskdef uri="antlib:com.googlecode.flyway.ant"
resource="com/googlecode/flyway/ant/antlib.xml"
classpathref="flyway.lib.path"/>
<flyway:init driver="oracle.jdbc.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:WBMD"
user="system"
password="manager"
initVersion="0"
initDescription="Version table initialization (table "USERNAME"."schema_version" )"/>
<flyway:migrate driver="oracle.jdbc.driver.OracleDriver"
url="jdbc:oracle:thin:@localhost:1521:WBMD"
user="system"
password="manager"
sqlMigrationPrefix="patch" >
<locations>
<location path="integrations-runtime/HELIOS/1-9-0/nlip-0-5-0/migration/system"/>
</locations>
</flyway:migrate>
</target>
关于如何修复它的任何建议?