diff --git a/Program.cs b/Program.cs index 67741f4..0c004e4 100644 --- a/Program.cs +++ b/Program.cs @@ -651,7 +651,7 @@ class Program while (await tableInfo.ReadAsync()) { - existingColumns.Add(tableInfo["name"].ToString()); + existingColumns.Add(tableInfo["name"]?.ToString() ?? string.Empty); } foreach (var column in requiredColumns) @@ -665,13 +665,13 @@ class Program alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Priority TEXT NOT NULL DEFAULT 'низкий';"; break; case "Room": - alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Room TEXT NOT NULL;"; + alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Room TEXT NOT NULL DEFAULT '';"; break; case "Description": - alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Description TEXT NOT NULL;"; + alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Description TEXT NOT NULL DEFAULT '';"; break; case "ReporterName": - alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN ReporterName TEXT NOT NULL;"; + alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN ReporterName TEXT NOT NULL DEFAULT '';"; break; case "DateCreated": alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN DateCreated DATETIME DEFAULT CURRENT_TIMESTAMP;"; @@ -715,6 +715,8 @@ class Program + + private static Dictionary userReportSteps = new Dictionary(); private static Dictionary userReports = new Dictionary();