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
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 boxThanks 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.