Failure to Execute the DBCommand: SQLite Err. 1 - C# / .NET / Entity Framework Core

40 Views Asked by At

After performing a migrations scaffold with the .NET CLI for EF migrations, there is a continual error in the terminal output where the SQLite extension already sees an existing table with the same name that was passed to the dotnet ef database update command.

Whenever the database attempts to be created, the following console output keeps occurring:

SQLite Error 1: "table 'table_name' already exists."

DbCommand Failure: SQLite Err #1

Attempts to resolve:

  • Reverting to previous migrations before rebuilding database with dotnet ef database update command.
  • Adding "0" flag to revert to previous migration instance with dotnet ef database update 0 command.
  • Removing scaffold with dotnet ef migrations remove command.
  • Rebuilding with dotnet ef migrations add -o command for appropriate current working directory.
  • Reinstalling dotnet ef framework.

Also, reference to this following author on StackOverflow did not apply for this particular issue:

How to fix an SQLite Error 1 in a C# .NET Entity Framework Core Model?

The "hoped for" outcome for reverting or rebuilding is for a clean migrations scaffold in case that may be the cause for duplication.

Also, not sure if related, but null references have been "disabled" in the API file that .NET requires for this project.

0

There are 0 best solutions below