修复迁移事务和数据库切换边界
Security Checks / security (push) Waiting to run

This commit is contained in:
xuans committed 2026-09-06 06:34:10 +08:00
1 parent 8ca7187721
commit 8bd6f1edfb
8 files changed
+286 -21

No files matched your search

@@ -9,6 +9,9 @@ import (
// 仅迁移 Smail 版本化业务表;不能静默忽略自定义对象。
func validatePortableObjects(ctx context.Context, database portableQuery, kind config.DatabaseType) error {
queries := []string{"SELECT COUNT(*) FROM sqlite_master WHERE type IN ('view','trigger')"}
if kind == config.DatabaseTypeSQLite {
queries = append(queries, "SELECT COUNT(*) FROM sqlite_master WHERE type='index' AND sql IS NOT NULL")
}
switch kind {
case config.DatabaseTypeMySQL:
queries = []string{