Files
xk-hy-transit-go/internal/db/truncate.go
2026-05-27 08:18:07 +08:00

20 lines
449 B
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package db
// TruncateAuditTables 清空本机审计三表(不可恢复)。
// 顺序hy_push_log → hy_push_record → hy_sync_job。
func (s *Store) TruncateAuditTables() error {
if err := s.Ping(); err != nil {
return err
}
for _, q := range []string{
`TRUNCATE TABLE hy_push_log`,
`TRUNCATE TABLE hy_push_record`,
`TRUNCATE TABLE hy_sync_job`,
} {
if _, err := s.db.Exec(q); err != nil {
return err
}
}
return nil
}