Using Elsa workflow with MySql database - elsa-workflows

I am trying to use Elsa workflow and to run it with database MySql, when application start and Elsa migrations run the following error happens
System.InvalidOperationException: 'A schema "Elsa" has been set for an object of type "AddColumnOperation" with the name of "DefinitionVersionId". MySQL does not support the EF Core concept of schemas. Any schema property of any "MigrationOperation" must be null. This behavior can be changed by setting the SchemaBehavior option in the UseMySql call.'
when i changed the schemabehavior another error happened, anyone faced this before?

Try this:
dbContextBuilder.UseMySql(connectionString, ServerVersion.AutoDetect(connectionString), mysql => mysql.MigrationsAssembly(typeof(Elsa.Persistence.EntityFramework.MySql.MySqlElsaContextFactory).Assembly.FullName)
.SchemaBehavior(MySqlSchemaBehavior.Ignore));
This ran the migrations without error for me.

Related

Entity Framework update-database prefixes tables

I am running the update-database command in VS to create tables in a DB for a project developed by someone else. For some reason, when i run the command, all the tables are prefixed with my domain\username. The same also happens for one of my collegues, meaning we now have two sets of tables! Any idea how we stop this happening?
This happens on when you are not a database owner and the object names are not schema-qualified. So either run the migration as a database owner, or specify a schema in the model configuration to force all the objects into the dbo schema.

Why do I have to disable Javers' schema management in order to initialize my application?

In my Spring-Boot project when:
javers.sqlSchemaManagementEnabled=true
The Javers tables are created on the first execution (when the tables do not exist on the database) and the code runs as expected, however from the second execution onwards an exception is thrown describing that the tables cannot be created because them already exist. This is the situation that I cannot understand, isn't Javers supposed to know that the tables already exist and do not attempt to create the tables?
javers.sqlSchemaManagementEnabled=false
If the tables where already created on the database, manually or executing the application with this option as 'true' at least once, the application executes as expected.
What am I supposed to do?
Is there something wrong with my Spring-Boot configuration? The application was supposed to run with 'sqlSchemaManagementEnabled=true' even with the tables already created?
I expected is to leave the 'sqlSchemaManagementEnabled=false' and create the tables manually?
I had the same problem, when using other than public schema in PostgreSQL.
I solved it by switching to public schema, now it works correctly with javers.sqlSchemaManagementEnabled=true.
For other schemas, you should somehow specify the schema name in org.javers.repository.sql.schema.TableNameProvider
If javers.sqlSchemaManagementEnabled=true, Javers creates SQL tables if they do not exists already.
It's checked here:
https://github.com/javers/javers/blob/master/javers-persistence-sql/src/main/java/org/javers/repository/sql/schema/JaversSchemaManager.java#L215
It's hard to say why it doesn't work in your case, try to debug this code using the latest Javers version.

Migration Error in Entity Framework with Oracle Database

I am using Code First, and I want to migrate it to ORACLE database, after multiple migrations process, I am getting this error,
The best overloaded method match for Oracle.ManagedDataAccess.EntityFramework.OracleMigrationSqlGenerator.Generate(System.Data.Entity.Migrations.Model.CreateTableOperation) has some invalid arguments
I'm facing the same problem
finally I solve it by opening the database and delete the migration_history table manually
and run the command again.
see at EF5 Code First - Changing A Column Type With Migrations
in each migration you will save a record in __MigrationHistory, so in case there is no sync between the code and the migration do the following:
delete the migration history table in the database.
migrate it again by create new migration 'in package manager console' add-migration data.
update the migration to database update-database

Elmah Oracle database

I'm trying to use Elmah on one of my recent project.
I'm using an oracle database so I got the oracle script for Elmah, but I'm sure I'm doing something wrong because when I run the scrip I get this error:
Any ideas?
Thank for your time!

What causes a JDBC Type 91 error?

I have a web app hosted on BEA Weblogic 10.x with an Oracle 10g database backend.
It works perfectly with one database, but when we make a clone of it and try to use a different WebLogic and Oracle instance we are getting this error:
ERROR - Problem initializing invocation tracking - disabling
tracking xxxxclass.BadTableMappingException: Database column
xxxxPeriodEnding in database yyyyyyy, table zzzzzzz has an
unknown type: JDBC Type 91.
We get it every time we do a query that involves a column of type DATE. There was no ORA-XXXX code in the message.
I can access the database using SQL*Plus using the same access and do selects and updates on the same tables with no errors.
The answer to this question is not just a simple description of what a type 91 error is (although that will help) but what could be causing this given the circumstances described above.
I am using ojdbc14.jar for JDBC on both instances of weblogic.
I have no idea about the error, but have you considered the jdbc jar version and more importantly if the oracle DB needs to be updated.
I faced very weird problems with oracle, and struggled for a while to find at the end that installing some patches for oracle would solve the problem.
Set oracle.jdbc.V8Compatible=true.
This remaps the oracle DATE type to a DATETIME time in JDBC. This parameter was missing on the new Weblogic server.

Resources