Converting the Sqlite template to Postgresql
Hello,
I started a new project with the template
It comes with a Sqlite Db. I want to change it to Postgres. I installed the packages and change UseSqlite to UseNpgsql. It connects to my db and the initial migration works, it creates the tables on my db. The issue i'm having is if I try to create a user for example, I get :
I guess there is some casting going on and Postgres doesn't want to use a boolean as an integer.
If I look into I see :
The issue I have is that this file is auto generated. If I search the field EmailConfirmed that's pretty much all I have. The variable declaration and this. At that point can I tell EF to make sure the colu;mn stays a bool ?
6 Replies
You will need to recreate your migrations if you swap provider
They contain dB specific stuff, as you noticed
Delete all migrations, drop tables and recreate migrations ?
Yup
Alright, thanks a lot !
Delete the snapshot too
That makes a lot of sense actually, I need to get better at databases, thanks for your help