fix: 添加缺失的cloud_type_uid列(CREATE TABLE和迁移)
This commit is contained in:
@@ -39,6 +39,7 @@ function runMigrations(db: Database.Database): void {
|
|||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
cloud_type TEXT NOT NULL,
|
cloud_type TEXT NOT NULL,
|
||||||
cookie TEXT,
|
cookie TEXT,
|
||||||
|
cloud_type_uid TEXT DEFAULT NULL,
|
||||||
nickname TEXT,
|
nickname TEXT,
|
||||||
is_active INTEGER NOT NULL DEFAULT 1,
|
is_active INTEGER NOT NULL DEFAULT 1,
|
||||||
storage_used TEXT,
|
storage_used TEXT,
|
||||||
@@ -204,6 +205,7 @@ function migrateCloudConfigs(db: Database.Database): void {
|
|||||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||||
cloud_type TEXT NOT NULL,
|
cloud_type TEXT NOT NULL,
|
||||||
cookie TEXT,
|
cookie TEXT,
|
||||||
|
cloud_type_uid TEXT DEFAULT NULL,
|
||||||
nickname TEXT,
|
nickname TEXT,
|
||||||
is_active INTEGER NOT NULL DEFAULT 1,
|
is_active INTEGER NOT NULL DEFAULT 1,
|
||||||
storage_used TEXT,
|
storage_used TEXT,
|
||||||
@@ -251,6 +253,13 @@ function migrateCloudConfigs(db: Database.Database): void {
|
|||||||
db.exec("ALTER TABLE cloud_configs ADD COLUMN notify_config TEXT DEFAULT NULL");
|
db.exec("ALTER TABLE cloud_configs ADD COLUMN notify_config TEXT DEFAULT NULL");
|
||||||
console.log('[DB] cloud_configs migration: notify_config column added');
|
console.log('[DB] cloud_configs migration: notify_config column added');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Migration 6: Add cloud_type_uid column
|
||||||
|
const hasCloudTypeUid = db.prepare("SELECT sql FROM sqlite_master WHERE name='cloud_configs' AND sql LIKE '%cloud_type_uid%'").get();
|
||||||
|
if (!hasCloudTypeUid) {
|
||||||
|
db.exec("ALTER TABLE cloud_configs ADD COLUMN cloud_type_uid TEXT DEFAULT NULL");
|
||||||
|
console.log('[DB] cloud_configs migration: cloud_type_uid column added');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user