-1

Everything works great on my local machine where the database owner is 'dbo'. But then I deploy it to a shared hosting site who won't let us use 'dbo'. Instead the table owner is the sql server user who I connect as. We'll call him 'sheldoncooper'. So all my tables are sheldoncooper.AspNetUsers, sheldoncooper.AspNetRoles, sheldoncooper.AspNetUserClaims, and so on.

It looks like the Identity system is looking for a hardcoded dbo.AspNetUsers, dbo.AspNetRoles, etc.

How do I tell it to NOT key on dbo?

[Edit] NVM, This is definitely a dup.

Rap
  • 6,851
  • 3
  • 50
  • 88

1 Answers1

0

You can either specify per table the schema to use, but in your case it's probably easier to globally change it by overriding the OnModelCreating method like this:

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
    // You can globally assign schema here
    modelBuilder.HasDefaultSchema("sheldoncooper");
}
DavidG
  • 113,891
  • 12
  • 217
  • 223