新增KV数据库存储附件

This commit is contained in:
eoao
2025-10-21 20:45:20 +08:00
parent dad4a22356
commit fdf9e95d67
18 changed files with 213 additions and 73 deletions

View File

@@ -22,10 +22,22 @@ const init = {
await this.v1_6DB(c);
await this.v1_7DB(c);
await this.v2DB(c);
await this.v2_3DB(c);
await settingService.refresh(c);
return c.text(t('initSuccess'));
},
async v2_3DB(c) {
try {
await c.env.db.batch([
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN force_path_style INTEGER NOT NULL DEFAULT 1;`),
c.env.db.prepare(`ALTER TABLE setting ADD COLUMN kv_storage INTEGER NOT NULL DEFAULT 1;`)
]);
} catch (e) {
console.error(e.message)
}
},
async v2DB(c) {
try {
await c.env.db.batch([