'The string argument 'migrationId' cannot be empty.' - entity-framework

Blocked on a weird error. I am working in an asp.net core web application, and using EF core 1.1.0 in it.
EF database migration is throwing error 'The string argument 'migrationId' cannot be empty.' when trying to execute below command
dbcontext.Database.Migrate();
Performed accepted answer from the the link but it did not solved my issue.
Uninstall donet 2.0.0, installed 1.1.0 and restarted PC. Still i am getting the same error.
Can anyone please help me on this.

When you have MigrationID column with in __EFMigrationsHistory table is empty you will have above issue. Make sure you delete this record manually and rerun the command. Please find screen shot for the same.

I had solved my issue.
Just deleted development database and executed migration on start.
It working now perfectly.

Related

Error while add migration to create database in Entity Framework 6, method not found CoreTypeMappingParameters

I'm trying to run add migration to create database on my local machine, in the last seconds I get this error:
Method not found: 'Void CoreTypeMappingParameters..ctor(System.Type, Microsoft.EntityFrameworkCore.Storage.ValueConversion.ValueConverter, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, Microsoft.EntityFrameworkCore.ChangeTracking.ValueComparer, System.Func`3<Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator>)'.
Here is my Program.cs :
I have no idea where to look, any suggestion?
I found the solution for my problem based on the video in this article
click here
the solution is to make all the packages have the same version as Palemo.EntityFrameworkCore.MySql = 6.0.1 .
This made it work and create the migration for Mysql.
If anyone has faced the same error, in your solution if you have different projects, check if the Microsoft Core version and tools versions are the same, removed them all re-installed the packages, the error is gone

Migrating liquibase from version 3.5.3 to 4.8.0 causes databasechangelog md5sum column being set to NULL

As written in the title, I've started migrating liquibase from 3.5.3 version to the 4.8.0
and when I start migration, instead of updating md5sum column of databasechangelog table for those 3.5.3 entries to the new checksum value it is updated to NULL and never recalculated.
For such a migration i am calling Java Liquibase#update(Contexts contexts, LabelExpression labelExpression) method, and underlying database that I am using is postgreSQL. No error is thrown, it's just md5sum column being overriden with NULL value.
New migrations are getting correct md5sum value, looking somthing like 8:92a9dbde7a04a1d2ee1aec16beaf0d6b.
Is anyone else having similar issue? Found this, but even when I updated my liquibase-core library to version 4.9.0, I was having the same problem
I have found workaround for this issue by upgrading liquibase to version 3.6 first and then I bumped it to 4.8. Everything is explained here on the issue that I have created on liquibase project repo: https://github.com/liquibase/liquibase/issues/3109
Is there a specific reason why you aren't updating to the most recent version?
As you note, the issue was fixed in 4.9.0. This PR has some details about how it was tested. You could try to replicate those tests using your configuration and see if it works. https://github.com/liquibase/liquibase/pull/2589
I would recommend trying to update to 4.14 and see if the issue persists.

Xcode Missing required module 'SQLiteObjc' with Sqlite.swift

I am using SQLite.swift to connect to a database but am getting "Missing required module 'SQLiteObjc'" on the import of SQLite.
I believe I have connected it properly.
Here is another screenshot I took. It seems to be reading the SQLiteObjc module but it still throws the error. Help somebody please :((
Is there anything else I am missing?
I solved it just in case anybody reads this and is having the same problem.
My problem was that I was manually installing SQLite.swift.
Instead I removed the framework and then did Add Package Dependency via the github URL.
I am no longer getting the error. Silly me.

Error builtin:list-members on trying auto complete in mysql workbench

Till yesterday auto complete was working in mysql workbench. Today getting below error on trying auto complete(Ctrl+space).
Kindly help to resolve it if you have an idea.
I restarted MySQL Workbench and now its working fine.
It appears this is a known bug in MySQL workbench since 2018: bugs.mysql.com...
Others have had success from rolling back to version 6.3.10. The bug is still present in the current version 8.0.23.
Another potential solution is delete the .column_widths file in:
[username]\AppData\Roaming\MySQL\Workbench\cache
Ironically Mysql Workbench's .column_widths appear to be a sqlite version 3 file
I believe you corrupted your Workbench installation somehow, so the easiest way to fix that is to re-install the application.

How to use Entity Framework code-first

I created some classes, and configured the connection string.
But still got an error:
Unhandled Exception: System.NotSupportedException: Model compatibility cannot be
checked because the database does not contain model metadata. Model compatibility
can only be checked for databases created using Code First or Code First Migrations.
Check the EF version you have, latest is 4.3.1.
You also need to configure a DbContext class. check this: http://msdn.microsoft.com/en-us/data/gg685467
i fixed it
by Run the ‘Enable-Migrations’ command in Package Manager Console.
Here is what worked for me if you are fine with deleting and recreating the database from scratch.
First, run the following commands from package manager console.
sqllocaldb.exe stop v11.0
sqllocaldb.exe delete v11.0
Next, delete the mdf and ldf files from the app_data folder of your project.
Here comes the critical part. Usually you will run update-database. If you do that the exception will still be thrown.
DO NOT Run update-database. INSTEAD directly run your project code. The EF will recreate the database.
These steps worked for me. Let me know if this helps you.