From 0dabb46dd8151e032cc5bf02d2b26e4e4668e3fd Mon Sep 17 00:00:00 2001 From: hackycy Date: Wed, 8 Jul 2020 11:11:04 +0800 Subject: [PATCH] =?UTF-8?q?feature=EF=BC=9Aupgrade=20sqlite=20version=20to?= =?UTF-8?q?=20add=20aliyun=20row?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/resources/pb_type_keys.dart | 4 ++-- lib/utils/db_provider.dart | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/resources/pb_type_keys.dart b/lib/resources/pb_type_keys.dart index 2356f75..1e7fcc8 100644 --- a/lib/resources/pb_type_keys.dart +++ b/lib/resources/pb_type_keys.dart @@ -1,5 +1,4 @@ class PBTypeKeys { - static const github = 'github'; static const smms = 'smms'; @@ -8,4 +7,5 @@ class PBTypeKeys { static const qiniu = 'qiniu'; -} \ No newline at end of file + static const aliyun = 'aliyun'; +} diff --git a/lib/utils/db_provider.dart b/lib/utils/db_provider.dart index 047b5c0..7bd1663 100644 --- a/lib/utils/db_provider.dart +++ b/lib/utils/db_provider.dart @@ -34,7 +34,7 @@ class DbProvider { try { db = await openDatabase( path, - version: 4, + version: 5, onCreate: (db, version) async { // 创建pb_setting表 _initPb(db); @@ -99,6 +99,9 @@ class DbProvider { // Qiniu图床 await db.rawInsert( 'INSERT INTO $TABLE_NAME_PBSETTING(type, path, name, config, visible) VALUES("${PBTypeKeys.qiniu}", "/setting/pb/qiniu", "七牛图床", NULL, 1)'); + // 阿里云OSS + await db.rawInsert( + 'INSERT INTO $TABLE_NAME_PBSETTING(type, path, name, config, visible) VALUES("${PBTypeKeys.aliyun}", "/setting/pb/aliyun", "阿里云OSS图床", NULL, 1)'); // copy data // update authors set dynasty_index=(select id from dynasties where dynasties .name=authors.dynasty) where dynasty in (select name from dynasties ) if (isExists) {