Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EF6 + Postgres relation dbo.AspNetUsers does not exist

I have been following this post on using PostgreSQL with EF6 http://www.jasoncavett.com/blog/postgresql-and-entity-framework-6-code-first/.

I have started a brand new MVC5 project hoping to use Postgres in my application for backend. The application starts up fine however when you go to register a user (I selected individual authentication) I get the following error messsage

ERROR: 42P01: relation "public.AspNetUsers" does not exist

I am unsure as to how to resolve this problem.

The error happens on line 155 which can be seen here

More information can be provided if needed.

like image 868
Johnathon64 Avatar asked May 30 '15 19:05

Johnathon64


3 Answers

I had ran the application before migrating to Postgres so all I needed to was to add a migration and update database through the package manager console.

like image 159
Johnathon64 Avatar answered Nov 18 '22 02:11

Johnathon64


If you see this Error in 2018, the answer is because the table has not being added to the migrations.

dotnet ef migrations add 01_users && dotnet ef database update

like image 23
saviour123 Avatar answered Nov 18 '22 01:11

saviour123


It is interesting but when i write as below it works on tableplus;

select *
from "AspNetUsers";

or

select "UserName"
from "AspNetUsers";
like image 1
Murat Can OĞUZHAN Avatar answered Nov 18 '22 02:11

Murat Can OĞUZHAN