fix issues

This commit is contained in:
yanghao05
2023-07-06 19:05:29 +08:00
parent f75985f797
commit c4ec53b4d0

View File

@@ -7,5 +7,9 @@ import (
)
func TruncateTable(db *gorm.DB, table string) {
if db.Dialector.Name() == "postgres" {
db.Exec(fmt.Sprintf("TRUNCATE TABLE %s RESTART IDENTITY", table))
return
}
db.Exec(fmt.Sprintf("TRUNCATE TABLE %s", table))
}