mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-10 17:26:38 +08:00
refactor(zone): remove legacy route domain storage
第二阶段清理:删除 of_managed_domains 与 of_proxy_routes 冗余域名/证书列, 移除 ManagedDomain 模型与 API、路由侧 legacy 字段维护,以及前端 WebsiteService。 ImportLegacy 在旧列/旧表缺失时跳过对应源,保持幂等。
This commit is contained in:
@@ -83,6 +83,24 @@ func TestMigrateInitializesSQLiteDatabase(t *testing.T) {
|
||||
if !sqliteDB.Migrator().HasTable("of_zone_domains") {
|
||||
t.Error("Migrate() did not create of_zone_domains")
|
||||
}
|
||||
if sqliteDB.Migrator().HasTable("of_managed_domains") {
|
||||
t.Error("Migrate() should drop of_managed_domains after phase-2 cleanup")
|
||||
}
|
||||
if sqliteDB.Migrator().HasColumn(&model.ProxyRoute{}, "domain") {
|
||||
t.Error("Migrate() should drop of_proxy_routes.domain after phase-2 cleanup")
|
||||
}
|
||||
if sqliteDB.Migrator().HasColumn(&model.ProxyRoute{}, "domains") {
|
||||
t.Error("Migrate() should drop of_proxy_routes.domains after phase-2 cleanup")
|
||||
}
|
||||
if sqliteDB.Migrator().HasColumn(&model.ProxyRoute{}, "cert_id") {
|
||||
t.Error("Migrate() should drop of_proxy_routes.cert_id after phase-2 cleanup")
|
||||
}
|
||||
if sqliteDB.Migrator().HasColumn(&model.ProxyRoute{}, "cert_ids") {
|
||||
t.Error("Migrate() should drop of_proxy_routes.cert_ids after phase-2 cleanup")
|
||||
}
|
||||
if sqliteDB.Migrator().HasColumn(&model.ProxyRoute{}, "domain_cert_ids") {
|
||||
t.Error("Migrate() should drop of_proxy_routes.domain_cert_ids after phase-2 cleanup")
|
||||
}
|
||||
|
||||
zone := model.Zone{Domain: "example.com"}
|
||||
if err := sqliteDB.Create(&zone).Error; err != nil {
|
||||
|
||||
Reference in New Issue
Block a user