I'm using flyway-ant 4.0.
I could see sql stmts and update count , while using -X option in command line mode.
How to get "'updated row count'" in ant debug mode?
Based on this issue from their repo, code supposed to work and is part of Flyway 4.0.
You will get affected rows counts in the log file, the contents would be alike:
2016-01-24 22:40:23.417 DEBUG [ main] o.f.core.internal.dbsupport.SqlScript : Executing SQL: update employees set i=5 where name='test1'
2016-01-24 22:40:25.145 DEBUG [ main] o.f.c.internal.dbsupport.JdbcTemplate : Update Count: 1
2016-01-24 22:40:25.145 DEBUG [ main] o.f.core.internal.dbsupport.SqlScript : Executing SQL: delete from employees where i=2
2016-01-24 22:40:25.797 DEBUG [ main] o.f.c.internal.dbsupport.JdbcTemplate : Update Count: 1
Note, that Flyway logs the update count as soon as at least one row was affected.
Please, reference the issue provided for more information, or please, provide more details on what you are doing and what you are getting in result.
Related
I am creating entities in the API Platform. Everytime I add a new entity or modify a field I run
docker-compose exec php bin/console doctrine:schema:update --force
to synchronize the schema. I faced no problems this far but after I created a datetime field and tried synchronizing I get a table already exists error
In AbstractPostgreSQLDriver.php line 66:
An exception occurred while executing 'CREATE SEQUENCE financial_statement_templates_definition_fstemplate_definition_id_seq INCREMENT BY 1 MINVALUE 1 START 1':
In PDOConnection.php line 83:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "financial_statement_templates_definition_fstemplate_definition_" already exists
In PDOConnection.php line 78:
SQLSTATE[42P07]: Duplicate table: 7 ERROR: relation "financial_statement_templates_definition_fstemplate_definition_" already exists
In the normal case I would have just dropped the tables and recreated it but since I am using the API Platform within docker I have no access to the database. Is there a way to resolve this?
Managed to figure this out. I dropped the database by running the following command
docker-compose exec php bin/console doctrine:database:drop --force
Then recreated the database using this statement from the command line
docker-compose exec php bin/console doctrine:database:create
Then updated the schema using this statement
docker-compose exec php bin/console doctrine:schema:update --force
Updating database schema...
6 queries were executed
[OK] Database schema updated successfully!
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
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)
I am trying to refresh Materialised view using Flyway DB but below error coming
Help....is this supported or not?
Below SQL
ALTER MATERIALIZED VIEW TEST.TBL_M_V REFRESH COMPLETE ON DEMAND;
EXECUTE DBMS_MVIEW.REFRESH('TEST.TBL_M_V','C');
ALTER MATERIALIZED VIEW TEST.TBL_M_V NEVER REFRESH;
Below error coming
ERROR: Migration of schema "TEST" to version 4.1 failed! Please restore backu
ps and roll back database and code!
ERROR:
Migration V4_1__MViewRefresh_Test.sql failed
--------------------------------------------------
SQL State : 42000
Error Code : 900
Message : ORA-00900: invalid SQL statement
Location : C:/dev/flyway-3.1/sql/V4_1__MViewRefresh_Test.sql
Line : 8
Statement : EXECUTE DBMS_MVIEW.REFRESH('TEST.TBL_M_V','C')
As the error says, it is not a Flyway issue. The Oracle JDBC driver refused your statement.
This is the correct syntax you should use:
BEGIN
DBMS_MVIEW.REFRESH('TEST.TBL_M_V','C');
END;
I'm trying to install a .NET 3.5 web application I on a Win 2003 server with IIS6. The application installed fine a few versions ago and the old msi still works. As far as I know nothing has changed with the installer apart from a version number, one more dll in the application and the ProductCode of the setup project. However, the latest msi stops with the message:
The installer was interrupted before <ApplicationName> could be
installed. You need to restart the installer to try again.
The log contains this error:
MSI (c) (B8:0C) [23:12:38:964]: Doing action: WEBCA_GatherAppPools
MSI (c) (B8:0C) [23:12:38:964]: Note: 1: 2205 2: 3: ActionText
Action start 23:12:38: WEBCA_GatherAppPools.
MSI (c) (B8:0C) [23:12:38:964]: Note: 1: 2235 2: 3: ExtendedType 4: SELECT `Action`,`Type`,`Source`,`Target`, NULL, `ExtendedType` FROM `CustomAction` WHERE `Action` = 'WEBCA_GatherAppPools'
MSI (c) (B8:88) [23:12:38:995]: Invoking remote custom action. DLL: C:\DOCUME~1\had012SA\LOCALS~1\Temp\1\MSIA0.tmp, Entrypoint: GatherAppPools
INFO : [10/14/2011 23:12:39:042] [GatherAppPools ]: Custom Action is starting...
INFO : [10/14/2011 23:12:39:042] [GatherAppPools ]: CoInitializeEx - COM initialization Apartment Threaded...
MSI (c) (B8!84) [23:12:39:042]: Note: 1: 2205 2: 3: ComboBox
MSI (c) (B8!84) [23:12:39:042]: Note: 1: 2228 2: 3: ComboBox 4: INSERT INTO `ComboBox` (`Property`,`Order`,`Value`,`Text`) VALUES (?, ?, ?, ?) TEMPORARY
ERROR : [10/14/2011 23:12:39:042] [GatherAppPools ]: FAILED: -2147023281
ERROR : [10/14/2011 23:12:39:042] [GatherAppPools ]: Custom Action failed with code: '1615'
INFO : [10/14/2011 23:12:39:042] [GatherAppPools ]: Custom Action completed with return code: '1615'
Action ended 23:12:39: WEBCA_GatherAppPools. Return value 3.
This page says error 1615 is an SQL syntax error but the action is a standard MS action so I can't do much about. Does anyone have any idea how to fix this?
Thanks.
UPDATE: I've tried creating a new web app in Visual Studio 2008 and a setup project for it and that installer does not work either so I suspect it's something with my Visual Studio. I can't think of what though so I still need help...
UPDATE 2: Curiouser and curiouser... a colleague compiled the code without making any changes and the installer works. Now the question becomes what has happened to my VS2008 and how can I fix it?
could be a change in the projects database structure.
Possibly you have a database with an older version of the Combobox table from previous versions.
Try deleting the db before preforming a clean install of the application.