AppDbUpdater: Add schema_version 2
This commit is contained in:
@ -4,7 +4,7 @@ using System;
|
||||
namespace Elwig.Helpers {
|
||||
public static class AppDbUpdater {
|
||||
|
||||
public static readonly int RequiredSchemaVersion = 1;
|
||||
public static readonly int RequiredSchemaVersion = 2;
|
||||
|
||||
private static int _versionOffset = 0;
|
||||
private static readonly Action<SqliteConnection>[] _updaters = new[] {
|
||||
@ -74,7 +74,11 @@ namespace Elwig.Helpers {
|
||||
ExecuteNonQuery(cnx, $"PRAGMA schema_version = {toVersion * 100 + _versionOffset}");
|
||||
}
|
||||
|
||||
private static void UpdateDbSchema_1_To_2(SqliteConnection cnx) { }
|
||||
private static void UpdateDbSchema_1_To_2(SqliteConnection cnx) {
|
||||
ExecuteNonQuery(cnx, "DROP VIEW v_area_commitment");
|
||||
ExecuteNonQuery(cnx, "ALTER TABLE delivery_part DROP COLUMN weighing_reason");
|
||||
ExecuteNonQuery(cnx, "ALTER TABLE delivery_part ADD COLUMN weighing_reason TEXT CHECK(NOT (manual_weighing = FALSE AND weighing_reason IS NOT NULL))");
|
||||
}
|
||||
|
||||
private static void UpdateDbSchema_2_To_3(SqliteConnection cnx) { }
|
||||
}
|
||||
|
Reference in New Issue
Block a user