remove uuid

This commit is contained in:
sentriz
2019-04-18 15:20:05 +01:00
parent 0932b5c013
commit 83374706d2

View File

@@ -2,9 +2,6 @@ package db
import (
"time"
"github.com/jinzhu/gorm"
"github.com/twinj/uuid"
)
type CrudBase struct {
@@ -22,14 +19,3 @@ type Base struct {
IDBase
CrudBase
}
// BaseWithUUID is the base model with an UUIDv4 primary key
type BaseWithUUID struct {
IDBase
CrudBase
}
// BeforeCreate is called by GORM to set the UUID primary key
func (b *BaseWithUUID) BeforeCreate(scope *gorm.Scope) error {
return scope.SetColumn("ID", uuid.NewV4().String())
}