mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-01-14 01:25:38 -05:00
Fix migration
This commit is contained in:
@@ -15,10 +15,17 @@ public class FeedCenterEntities
|
||||
SchemaVersion = 2,
|
||||
MigrationCallback = (migration, oldSchemaVersion) =>
|
||||
{
|
||||
if (oldSchemaVersion == 1)
|
||||
migration.NewRealm.Add(Account.CreateDefault());
|
||||
Account localAccount;
|
||||
|
||||
var localAccount = migration.NewRealm.All<Account>().First(a => a.Type == AccountType.Local);
|
||||
if (oldSchemaVersion == 1)
|
||||
{
|
||||
localAccount = Account.CreateDefault();
|
||||
migration.NewRealm.Add(localAccount);
|
||||
}
|
||||
else
|
||||
{
|
||||
localAccount = migration.NewRealm.All<Account>().First(a => a.Type == AccountType.Local);
|
||||
}
|
||||
|
||||
var newVersionCategories = migration.NewRealm.All<Category>();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user