I have a database with several tables in AZURE SQL Server.
I want to add a new column to one of the tables, but I want to keep all the content of the tables including the table with the new column; hence I don't want to use the
Database.SetInitializer<MyDbContext>(new DropCreateDatabaseIfModelChanges<MyDbContext>());
My code looks like this:
public class DBTables : DbContext
{
public DBTables() : base(ProductKeys.GetDbKey())
{
}
public DbSet<ElementsForPointTable> ElementsForPointTable { get; set; }
public DbSet<StationsDetailsTable> StationsDetailsTable { get; set; }
}
How do I do it?
You could use migrations to update the database scheme.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.