Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Removing ASP.NET Identity tables from a database

How can I remove ASP.NET Identity tables from a database? Right now I have the following tables added to my database :

  • __MigrationHistory
  • AspNetRoles
  • AspNetUserClaims
  • AspNetUserLogins
  • AspNetUserRoles
  • AspNetUsers

I know that I could write something like the following :

DROP TABLE __MigrationHistory
DROP TABLE AspNetUserLogins
DROP TABLE AspNetUserRoles
DROP TABLE AspNetUserClaims
DROP TABLE AspNetRoles
DROP TABLE AspNetUsers

However I was wondering whether this is the right approach and if there is more elegant method of removing ASP.NET Identity tables and any other potential traces which I might have left out.

like image 227
MHOOS Avatar asked Sep 15 '25 10:09

MHOOS


1 Answers

You have to remove following tables from the database.

DROP TABLE __EFMigrationsHistory
Drop Table AspNetRoleClaims
DROP TABLE AspNetUserLogins
DROP TABLE AspNetUserRoles
DROP TABLE AspNetUserClaims
Drop Table AspNetUserTokens
DROP TABLE AspNetRoles
DROP TABLE AspNetUsers

Also you need to drop Identity schema, if it's already exists orphan in your database.

like image 148
Osman Taskiran Avatar answered Sep 17 '25 01:09

Osman Taskiran