mirror of
https://github.com/ckaczor/FeedCenter.git
synced 2026-02-03 17:24:24 -05:00
Compare commits
1 Commits
1.2.0.72-p
...
1.2.0.76
| Author | SHA1 | Date | |
|---|---|---|---|
| cdd22c6632 |
@@ -15,10 +15,17 @@ public class FeedCenterEntities
|
|||||||
SchemaVersion = 2,
|
SchemaVersion = 2,
|
||||||
MigrationCallback = (migration, oldSchemaVersion) =>
|
MigrationCallback = (migration, oldSchemaVersion) =>
|
||||||
{
|
{
|
||||||
if (oldSchemaVersion == 1)
|
Account localAccount;
|
||||||
migration.NewRealm.Add(Account.CreateDefault());
|
|
||||||
|
|
||||||
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>();
|
var newVersionCategories = migration.NewRealm.All<Category>();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user