тест бд

This commit is contained in:
Professional 2025-03-19 19:32:58 +07:00
parent a97fa75679
commit 4e256dfeb7

View File

@ -651,7 +651,7 @@ class Program
while (await tableInfo.ReadAsync()) while (await tableInfo.ReadAsync())
{ {
existingColumns.Add(tableInfo["name"].ToString()); existingColumns.Add(tableInfo["name"]?.ToString() ?? string.Empty);
} }
foreach (var column in requiredColumns) foreach (var column in requiredColumns)
@ -665,13 +665,13 @@ class Program
alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Priority TEXT NOT NULL DEFAULT 'низкий';"; alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN Priority TEXT NOT NULL DEFAULT 'низкий';";
break; break;
case "Room": 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; break;
case "Description": 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; break;
case "ReporterName": 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; break;
case "DateCreated": case "DateCreated":
alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN DateCreated DATETIME DEFAULT CURRENT_TIMESTAMP;"; alterTableCommand.CommandText = "ALTER TABLE Reports ADD COLUMN DateCreated DATETIME DEFAULT CURRENT_TIMESTAMP;";
@ -715,6 +715,8 @@ class Program
private static Dictionary<long, int> userReportSteps = new Dictionary<long, int>(); private static Dictionary<long, int> userReportSteps = new Dictionary<long, int>();
private static Dictionary<long, Report> userReports = new Dictionary<long, Report>(); private static Dictionary<long, Report> userReports = new Dictionary<long, Report>();