Skip to content

Commit

Permalink
GetMaxID support interface parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Dec 2, 2019
1 parent c858cfb commit 7173a04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions models/models.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 7173a04

Please sign in to comment.