This commit is contained in:
Administrator committed 2026-06-06 00:29:45 +08:00
commit e0c949bde9
4 files changed
+92 -46

No files matched your search

+8 -2
View File
@@ -215,7 +215,13 @@ namespace SunlightAggregationTerminal.Class
{
string sql = "ALTER TABLE Notification ADD COLUMN Type INT;";
SQLitedata.ExecuteNonQuery(sql, null);
}
}
// 检查 id
if (!existingColumns.Contains("Id"))
{
string sql = "ALTER TABLE Notification ADD COLUMN Id INTEGER PRIMARY KEY;";
SQLitedata.ExecuteNonQuery(sql, null);
}
}
}
private static void CheckAndRepairTableSchemaSERVER()
@@ -302,7 +308,7 @@ namespace SunlightAggregationTerminal.Class
// 建表语句
string createSql = @"
CREATE TABLE Notification (
Id INTEGER PRIMARY KEY AUTOINCREMENT,
Id INTEGER PRIMARY KEY,
Title TEXT,
Content TEXT,
Time TEXT,