It is almost inevitable that when updating your app, adding new features and so forth, you will want to make changes to your database schema. Fortunately, local database support on the phone includes the capability to perform additive changes to a database, such as adding tables, columns, indexes, or associations, while preserving the data in the database.
For more complex schema changes, however, such as dropping a column from a table, you need to create a new database and migrate the data to the new schema.
Note
Changes to your local database schema begin with changing the object model of the corresponding data context. Therefore, modify your entity classes first to reflect the desired state of the schema.
The Microsoft.Phone.Data.Linq.DatabaseSchemaUpdater
class provides four schema altering methods:
AddColumn<T>(
string columnPropertyName)
AddTable<T>()
AddAssociation<T>(
string associationPropertyName)
The following sections discuss each of these methods in greater detail.
18.223.158.21