mirror of
https://github.com/TeaOSLab/EdgeAPI.git
synced 2025-11-30 03:50:25 +08:00
实现基础的IP地址阈值
This commit is contained in:
@@ -367,8 +367,7 @@ func upgradeV0_3_0(db *dbs.DB) error {
|
||||
|
||||
// v0.3.1
|
||||
func upgradeV0_3_1(db *dbs.DB) error {
|
||||
// 忽略错误
|
||||
// 清空域名统计,已使用分表代替
|
||||
_, _ = db.Exec("TRUNCATE table edgeServerDomainHourlyStats")
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -20,3 +20,20 @@ func TestUpgradeSQLData(t *testing.T) {
|
||||
}
|
||||
t.Log("ok")
|
||||
}
|
||||
|
||||
|
||||
func TestUpgradeSQLData_v1_3_1(t *testing.T) {
|
||||
db, err := dbs.NewInstanceFromConfig(&dbs.DBConfig{
|
||||
Driver: "mysql",
|
||||
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge_new?charset=utf8mb4&timeout=30s",
|
||||
Prefix: "edge",
|
||||
})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
err = upgradeV0_3_1(db)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
t.Log("ok")
|
||||
}
|
||||
Reference in New Issue
Block a user