Update LinqtoSql database with new schema changes?

I have an application for Windows Phone 7 that has been published on the market. I am using Sql CE with LinqToSql. When the application starts, it checks for the presence of the database from the connection string and creates if it does not exist.

using (CheckbookDataContext db = new CheckbookDataContext(DBConnectionString)) { if (!db.DatabaseExists()) { isNewLoad = true; db.CreateDatabase(); } } 

When I start planning new features, I foresee some changes in the database schema, whether adding a new column to an existing table, adding new tables, etc.

How to upgrade an existing database? Should I manually execute the ALTER and CREATE table statements for my settings now that the database already exists?

+4
source share

Source: https://habr.com/ru/post/1387143/


All Articles