コード例 #1
0
        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;
            }
        }
コード例 #2
0
ファイル: UpdateDialog.xaml.cs プロジェクト: HADB/ListManager
 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;
     }
 }