C
C#2mo ago
Lx0044

UniqueIdentifer Type does not exist Ef Core

Good evening everyone, I am currently looking at moving from SQL Server to Postgres. When using GUID as my Id on tables the initial migration tries to set the column type to uniqueidentifer. I then get this error when running the migration: Npgsql.PostgresException (0x80004005): 42704: type "uniqueidentifier" does not exist Any suggestions?
2 Replies
Jimmacle
Jimmacle2mo ago
because it doesn't, the equivalent postgres type is uuid you won't be able to use any of your sql server migrations on postgres, migrations are tightly related to the database provider they were generated for and any EF code you have that relies on specific sql server features/behavior probably won't work either for example, sql server uses a case insensitive collation by default but postgres uses a case sensitive one so queries on text may not behave the same out of the box
Lx0044
Lx00442mo ago
Thanks for that Jimmacle, issue turned out being that I had a refernce to SQL Server in my DbDesignTimeFactory that was generating the bad initial migration.
Want results from more Discord servers?
Add your server
More Posts