c# - How do I instruct entity framework to choose migrations based on the current database? -
so when developer starts our application locally, against blank, localhost database. in production first need migrate of old asp.net membership framework tables , data new asp.net identity framework tables.
how can write ef6 migrations consider this? also, our existing production database has no __migration table in it.
when moving identity membership data ported old tables: can create tables according identity schema using sql scripts. else if change app use identity, running , creating user first time create tables via code first. can copy data old tables through console application or via sql scripts.
if want run migrations create new identity tables before run application, can running following steps - enable-migrations - add-migration - update-database
this create empty tables according dbcontext. if extends identitydbcontext, create tables according identity schema along _migrationhistory table. hope helps
Comments
Post a Comment