我和flyway合作,看起来很有希望。所以,在根项目的pom.xml
文件中,我有这个:
<plugin>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>${flyway.version}</version>
<configuration>
<driver>com.microsoft.sqlserver.jdbc.SQLServerDriver</driver>
<url>jdbc:sqlserver://localhost</url>
<user>sa</user>
<password>dbPassword/</password>
<schemas>
<schema>schemaA</schema>
<schema>schemaB</schema>
</schemas>
</configuration>
<dependencies>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<version>${mssql.version}</version>
</dependency>
</dependencies>
</plugin>
在projectA&project和&#39; pom.xml
上,我有这个:
<dependency>
<groupId>org.flywaydb</groupId>
<artifactId>flyway-core</artifactId>
<version>${flyway.version}</version>
</dependency>
此外,在每个项目application.properties
上都有以下内容:
#flyway
flyway.baseline-description= #
flyway.baseline-version=1 # version to start migration
flyway.baseline-on-migrate= #
flyway.check-location=false # Check that migration scripts location exists.
flyway.clean-on-validation-error= #
flyway.enabled=true # Enable flyway.
#flyway.encoding= #
#flyway.ignore-failed-future-migration= #
#flyway.init-sqls= # SQL statements to execute to initialize a connection immediately after obtaining it.
flyway.locations=classpath:db/migration
#flyway.out-of-order= #
#flyway.placeholder-prefix= #
#flyway.placeholder-replacement= #
#flyway.placeholder-suffix= #
#flyway.placeholders.*= #
flyway.schemas=schemaX
#flyway.sql-migration-prefix=V #
#flyway.sql-migration-separator= #
#flyway.sql-migration-suffix=.sql #
flyway.table= #
flyway.url=jdbc:sqlserver://localhost
flyway.user=sa
flyway.password=dbPassword
flyway.validate-on-migrate= #
所以,为了让它成功,我在做什么:
sa
和密码dbPassword
在数据库上创建schemaA和schemaB。[projectA]/src/main/resources/db/migration/
的位置V1_0_Initialize.sql
放置,这会创建表格的结构并填充标准化数据。mvn clean flyway:migrate -DskipTests
在第3步,我收到错误消息:
[INFO] Current version of schema [dbo.schemaA]: null
[INFO] Migrating schema [dbo.schemaA] to version 1.0 - Initialize
以后几行:
[ERROR] Message : The specified schema name "dbo.schemaA" either does not exist or you do not have permission to use it.
如果我尝试使用DBMS导入脚本,一切都很完美。
我没有看到什么?
亲切的问候,