How to fake flyway migration? - flyway

Two of us made a migration script in different GIT branches. Now, I've pulled origin development branch, and I've corrected GIT merge issues, and renamed my migration script to be the last. So, the new initialization of DB and migration of DB from version of develop branch would be fine.
However, I've got a lot of data in my local testing DB, so I've manually applied new migration scripts that I've pulled in GIT. However, I can't make flyway think, that everything is okay.
So, How can I fake migrations?
When I try to migrate, I get following error:
[ERROR] Failed to execute goal org.flywaydb:flyway-maven-plugin:3.2.1:migrate (default-cli) on project db: org.flywaydb.core.api.FlywayException: Validate failed. Migration Description mismatch for migration 1.118
[ERROR] -> Applied to database : AAA
[ERROR] -> Resolved locally : BBB
[ERROR] -> [Help 1]

You will have to manually update Flyway's metadata table (called schema_version by default)

Related

cannot create luminus project with sqlite and clojurescript support

I am trying to create a luminus project with sqlite and cljs support with this command:
lein new dbscript +sqlite +cljs
but I keep getting this error message all the time:
Failed to resolve version for dbscript:lein-template:jar:RELEASE: Could not find metadata dbscript:lein-template/maven-metadata.xml in local (/home/jonas/.m2/repository)
Failed to read artifact descriptor for dbscript:lein-template:jar:RELEASE
This could be due to a typo in :dependencies, file system permissions, or network issues.
If you are behind a proxy, try setting the 'http_proxy' environment variable.
Could not find template dbscript on the classpath.
and I cannot find any solution to this. Any suggestions?

Corda Database Manager Failed to create datasource

Upgrading a Corda node from CE3.2 to CE4.0 and following these documentation steps:
Running ubuntu#ip-xyz:~$ java -jar tools-database-manager-4.0.jar dry-run -b /opt/corda/
Gives error:
Exporting the current database migrations ...
Failed to create datasource.
Please check that the correct JDBC driver is installed in one of the following folders:
- /opt/corda/drivers
- plugins
- cordapps
Caused By java.nio.file.NoSuchFileException: plugins
2019-05-23 22:24:16,284 Thread-0 WARN Unable to register Log4j shutdown hook because JVM is shutting down. Using SimpleLogger
I have all the required folders in place for drivers, plugins and cordapps and have installed MS SQL drivers mssql-jdbc-6.2.2.jre8.jar.
The "jarDirs" key in the node.conf was hiding the folders required for database migration.
By removing the following lines the database manager tool successfully completed the dry run.
"jarDirs" : [
"plugins",
"cordapps"
]

In Corda, schema cannot be cast to net.corda.core.schemas.MappedSchema exception

I am trying to create migration schemas for a CorDapp as per the instructions here. I am running the following command:
java -jar corda-tools-database-manager-3.1.jar
--base-directory /opt/User
--create-migration-sql-for-cordapp fnolUseCase.state.FNOLSchema
However, I am getting the following error:
-- 2018-08-22T13:29:23,145Z migration.tool.invoke - Creating database migration
files for schema: fnolUseCase.state.FNOLSchema into /opt/User/migration
Failed to create datasource.
Please check that the correct JDBC driver is installed in one of the following
folders:
- /opt/User/drivers
Caused By java.lang.ClassCastException: fnolUseCase.state.FNOLSchema cannot be cast
to net.corda.core.schemas.MappedSchema
What should I be doing differently?
It seems to be having trouble locating your fnolUseCase.state.FNOLSchema class. Try dropping the schema name from the end of your command. This will cause a migration schema to be created for every schema in your application:
java -jar corda-tools-database-manager-3.1.jar
--base-directory /opt/User
--create-migration-sql-for-cordapp fnolUseCase.state.FNOLSchema

Update-database command failed to create database

So I'm studying Entity Framework Core through the course I am following to. So in the video he run the update-database command and it went smoothly, well it is the opposite when I tried the command. I already done the add-migration then just need to execute the update-database commaand.
Here's the error.log: Error Log Link
I have some idea that it is because of my userprofile that I get this error since it contains spaces.
Anyways here the error message I get from the package manager console:
Error Number:5123,State:1,Class:16
CREATE FILE encountered operating
system error 5(Access is denied.) while attempting to open or create
the physical file 'C:\Users\Infinite RegressionAngelShop.mdf'.
CREATE DATABASE failed. Some file names listed could not be created. Check
related errors.
Try to update MSSql to the latest version. It worked for me.

Flyway - Cant run Multiple sql Scripts

My files - V3.2-alter.sql and V3.2-3insert_fmcc.sql
If i am running flyway - i get error ..
[ERROR] Failed to execute goal
org.flywaydb:flyway-maven-plugin:3.2.1:migrate (default) on project
SnapdealOPS: org.flywaydb.core.api.FlywayException: Found more than
one migration with version 3.2 Offenders:
[ERROR] ->
/home/kartikeya/git/SnapdealOPS/MySQLDB/release-V3.2/V3.2-1alter.sql
(SQL) [ERROR] -> /home/kartikeya/git/SnapdealOPS/MySQLDB/release-
V3.2/V3.2-3insert_fmcc.sql (SQL)
Cant i run multiple sql scripts for single version . Do i have to put all the queries in single file .
If you want two files, you need to give them two versions (like 3.2.0.0.1 and 3.2.0.0.2). That is how the order of application is defined.

Resources