diff --git a/models/models.go b/models/models.go index 7b4d71fc9cb42..8c10e7abfc1e6 100644 --- a/models/models.go +++ b/models/models.go @@ -267,8 +267,8 @@ func DeleteAllRecords(tableName string) error { } // GetMaxID will return max id of the table -func GetMaxID(tableName string) (maxID int64, err error) { - _, err = x.Select("MAX(id)").Table(tableName).Get(&maxID) +func GetMaxID(beanOrTableName interface{}) (maxID int64, err error) { + _, err = x.Select("MAX(id)").Table(beanOrTableName).Get(&maxID) return }