13 lines
355 B
Go
13 lines
355 B
Go
package models
|
|
|
|
import (
|
|
"github.com/uptrace/bun"
|
|
"time"
|
|
)
|
|
|
|
type ApiKey struct {
|
|
bun.BaseModel `bun:"table:apikeys"`
|
|
Key string `bun:"key,pk,type:uuid,default:gen_random_uuid()" json:"key,omitempty"`
|
|
UserName string `bun:"username,notnull" json:"username"`
|
|
Created time.Time `bun:"created,default:now()" json:"created"`
|
|
}
|