private void UpdateDatabase(int versionFrom, int versionTo) { FileBackup.BackupWithTime(Info.GetDirectory() + "\\data.db"); SQLite sqlite = new SQLite("data.db"); switch (versionTo) { case 2: sqlite.AddColumns(LIST_FAMILIES_TABLE_NAME, new List <string> { FIELD_NAME_SHOW_FINISHED_ITEM, FIELD_NAME_SHOW_ABANDONED_ITEM, FIELD_NAME_SHOW_OVERDUE_ITEM, FIELD_NAME_SORT_TYPE }, new List <string> { "INTEGER", "INTEGER", "INTEGER", "INTEGER" }); sqlite.Update(LIST_FAMILIES_TABLE_NAME, new List <string> { FIELD_NAME_SHOW_FINISHED_ITEM, FIELD_NAME_SHOW_ABANDONED_ITEM, FIELD_NAME_SHOW_OVERDUE_ITEM, FIELD_NAME_SORT_TYPE }, new List <string> { "1", "0", "1", "1" }, "list_family_id > '0'"); break; } }
private void UpdateDatabase(int versionFrom, int versionTo) { FileBackup.BackupWithTime(Info.GetDirectory() + "\\data.db"); SQLite sqlite = new SQLite("data.db"); switch (versionTo) { case 2: sqlite.AddColumns(LIST_FAMILIES_TABLE_NAME, new List<string> { FIELD_NAME_SHOW_FINISHED_ITEM, FIELD_NAME_SHOW_ABANDONED_ITEM, FIELD_NAME_SHOW_OVERDUE_ITEM, FIELD_NAME_SORT_TYPE }, new List<string> { "INTEGER", "INTEGER", "INTEGER", "INTEGER" }); sqlite.Update(LIST_FAMILIES_TABLE_NAME, new List<string> { FIELD_NAME_SHOW_FINISHED_ITEM, FIELD_NAME_SHOW_ABANDONED_ITEM, FIELD_NAME_SHOW_OVERDUE_ITEM, FIELD_NAME_SORT_TYPE }, new List<string> { "1", "0", "1", "1" }, "list_family_id > '0'"); break; } }