0

I want to use asp.net identity on a database that already exists.

I read this to do: How to add ASP.NET MVC5 Identity Authentication to existing database

but I am worried because I know asp.net identity uses code first, so can I lose my data? or it simply adds its tables to my db ? and in the future if I will update the asp.net identity package, can it drop the database?

** Now the database has only tables and some data (without others user/password tables)

Community
  • 1
  • 1
DevT
  • 1,411
  • 3
  • 16
  • 32
  • does it already have any passwords? – prospector Jan 21 '15 at 15:48
  • @prospector I've updated the firt post – DevT Jan 21 '15 at 16:06
  • As mentioned in the post you provided, you can easily add it to your existing database. So, there's no data lost. It just adds the tables to your database. You will only lose data if you specify your own database initializer (such as drop-create). Why do you want to drop the database when you update your Identity package? – Horizon_Net Jan 21 '15 at 16:15

1 Answers1

1

You shouldn't have any problems since you don't have existing users. The only time you'd have problems with migrating existing users to identity 2.0, because the password hashing, but you'll be good to go.

Always back up your database before you make any changes to the database though.

prospector
  • 3,389
  • 1
  • 23
  • 40