go-urlsh/models/apikey.go

15 lines
447 B
Go
Raw Normal View History

2023-04-27 10:37:42 +02:00
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"`
2023-05-05 15:16:54 +02:00
UserName string `bun:"username,notnull" json:"username,omitempty"`
Created time.Time `bun:"created,default:now()" json:"created,omitempty"`
Description string `bun:"description,notnull" json:"description"`
2023-04-27 10:37:42 +02:00
}