To use ASP.NET Identity in Oracle, I have to rename tables names specially schema name. I use the following code to change their names:
protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
base.OnModelCreating(modelBuilder);
modelBuilder.Entity<IdentityUser>().ToTable("TRN_ASPNET_USERS", "ADMIN");
modelBuilder.Entity<ApplicationUser>().ToTable("TRN_ASPNET_USERS", "ADMIN");
modelBuilder.Entity<IdentityUserRole>()
.HasKey(r => new { r.UserId, r.RoleId })
.ToTable("TRN_ASPNET_USER_ROLES", "ADMIN");
modelBuilder.Entity<IdentityUserLogin>()
.HasKey(l => new { l.LoginProvider, l.ProviderKey, l.UserId })
.ToTable("TRN_ASPNET_USER_LOGINS", "ADMIN");
modelBuilder.Entity<IdentityUserClaim>().ToTable("TRN_ASPNET_USER_CLAIMS", "ADMIN");
modelBuilder.Entity<IdentityRole>().ToTable("TRN_ASPNET_ROLES", "ADMIN");
base.OnModelCreating(modelBuilder);
}
What I end up with, while I am still using Micorsoft SQL Server. There are newly created tables like the ones I changed their names to. But the old tables names still exist (after recreating the database). And the Identity framework is using the old tables and storing data in the old tables - not in the new tables.
So tables names are changed, but the old tables still exist and are being used. Please help.