Entity Framework Core SQLite version

entity-framework-core

Question

I'm using EF Core v2.2.1 for SQLite and just made a new migration, where I renamed a field in the table.

Migration code looks like

migrationBuilder.RenameColumn(
    name: "OldColumnName",
    table: "Table",
    newName: "NewColumnName");

It creates following SQL when I apply migration:

ALTER TABLE "Table" RENAME COLUMN "OldColumnName" TO "NewColumnName";

Staring with SQLite 3.25 it is supported https://www.sqlite.org/changes.html

Enhancements the ALTER TABLE command:

    Add support for renaming columns within a table using ALTER TABLE table RENAME COLUMN oldname TO newname.
    Fix table rename feature so that it also updates references to the renamed table in triggers and views.

But in EF Core I receive an exception:

Error while executing SQL query on database 'MyDatabase': near "COLUMN": syntax error

Sounds like it uses old version of SQLite. How can check which version does EF Core use?

EDIT: I found a workaround, but actually my question is "how do I know which version of SQLite am I currently using?".

1
2
2/15/2019 12:17:46 PM

Popular Answer

Renaming column for sqlite db in ef core is limited and not supported you can find official limitation lists here

there is a bug report for this problem that you can find it here
and there is a workaround for this issue in here

1
2/15/2019 11:22:12 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow