实现基础的IP地址阈值

This commit is contained in:
刘祥超
2021-09-12 20:21:42 +08:00
parent 1ea7fe0213
commit 7fcc2b7dba
15 changed files with 616 additions and 100 deletions

View File

@@ -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
}

View File

@@ -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")
}