修复自动生成的用户没有绑定集群、用户名不规范的问题

This commit is contained in:
GoEdgeLab
2023-07-02 14:30:46 +08:00
parent 9cf7e6c564
commit 783f0c21ab
2 changed files with 53 additions and 0 deletions

View File

@@ -252,3 +252,23 @@ func TestUpgradeSQLData_v0_5_3(t *testing.T) {
t.Log("ok")
}
func TestUpgradeSQLData_v1_2_1(t *testing.T) {
db, err := dbs.NewInstanceFromConfig(&dbs.DBConfig{
Driver: "mysql",
Dsn: "root:123456@tcp(127.0.0.1:3306)/db_edge?charset=utf8mb4&timeout=30s",
Prefix: "edge",
})
if err != nil {
t.Fatal(err)
}
defer func() {
_ = db.Close()
}()
err = upgradeV1_2_1(db)
if err != nil {
t.Fatal(err)
}
t.Log("ok")
}