mirror of https://github.com/allinssl/allinssl
Merge remote-tracking branch 'origin/1.0.1' into 1.0.1
commit
7fbd615b32
|
@ -135,7 +135,12 @@ func Apply(cfg map[string]any, logger *public.Logger) (map[string]any, error) {
|
||||||
|
|
||||||
var skipCheck bool
|
var skipCheck bool
|
||||||
if cfg["skip_check"] == nil {
|
if cfg["skip_check"] == nil {
|
||||||
|
// 默认跳过预检查
|
||||||
skipCheck = true
|
skipCheck = true
|
||||||
|
// cf 默认不跳过预检查
|
||||||
|
if providerStr == "cloudflare" {
|
||||||
|
skipCheck = false
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
switch v := cfg["skip_check"].(type) {
|
switch v := cfg["skip_check"].(type) {
|
||||||
case int:
|
case int:
|
||||||
|
|
|
@ -11,11 +11,11 @@ import (
|
||||||
func EnsureDatabaseWithTables(targetDBPath string, baseDBPath string, tables []string) error {
|
func EnsureDatabaseWithTables(targetDBPath string, baseDBPath string, tables []string) error {
|
||||||
// 1. 检查数据库是否存在
|
// 1. 检查数据库是否存在
|
||||||
if _, err := os.Stat(targetDBPath); err == nil {
|
if _, err := os.Stat(targetDBPath); err == nil {
|
||||||
fmt.Printf("数据库 %s 已存在,跳过迁移。\n", targetDBPath)
|
// fmt.Printf("数据库 %s 已存在,跳过迁移。\n", targetDBPath)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Printf("数据库 %s 不存在,开始从基础数据库迁移表...\n", targetDBPath)
|
// fmt.Printf("数据库 %s 不存在,开始从基础数据库迁移表...\n", targetDBPath)
|
||||||
|
|
||||||
// 2. 打开源数据库(只读)和目标数据库(新建)
|
// 2. 打开源数据库(只读)和目标数据库(新建)
|
||||||
baseDB, err := sql.Open("sqlite", baseDBPath)
|
baseDB, err := sql.Open("sqlite", baseDBPath)
|
||||||
|
@ -71,7 +71,7 @@ func EnsureDatabaseWithTables(targetDBPath string, baseDBPath string, tables []s
|
||||||
rows.Close()
|
rows.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
fmt.Println("迁移完成。")
|
// fmt.Println("迁移完成。")
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue