fix issues
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user