完善用户管理与凭据事务处理
This commit is contained in:
1 parent
7f0af703ed
commit
0e2222bcfe
33 files changed
+2135
-68
No files matched your search
@@ -52,14 +52,14 @@ func TestSQLiteMigrationIsIdempotentAndCreatesBaseTables(t *testing.T) {
|
||||
if err := db.DB.QueryRow("SELECT COUNT(*) FROM schema_migrations").Scan(&versions); err != nil {
|
||||
t.Fatalf("读取迁移版本失败:%v", err)
|
||||
}
|
||||
if versions != 4 {
|
||||
if versions != latestMigrationVersion {
|
||||
t.Fatalf("重复迁移写入了多条版本记录:%d", versions)
|
||||
}
|
||||
var tables int
|
||||
if err := db.DB.QueryRow(`SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name IN ('settings', 'domains', 'tasks', 'audit_logs', 'servers', 'domain_servers')`).Scan(&tables); err != nil {
|
||||
if err := db.DB.QueryRow(`SELECT COUNT(*) FROM sqlite_master WHERE type = 'table' AND name IN ('settings', 'domains', 'tasks', 'audit_logs', 'servers', 'domain_servers', 'users')`).Scan(&tables); err != nil {
|
||||
t.Fatalf("检查基础数据表失败:%v", err)
|
||||
}
|
||||
if tables != 6 {
|
||||
if tables != 7 {
|
||||
t.Fatalf("基础数据表数量不正确:%d", tables)
|
||||
}
|
||||
if err := Migrate(context.Background(), db.DB, "postgres"); err == nil {
|
||||
|
||||
Reference in new issue
Block a user