model

package
v0.0.0-...-945dfcb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 12, 2021 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type User

type User struct {
	ID             uuid.UUID `bun:"type:uuid,default:uuid_generate_v4()"`
	CreatedAt      time.Time `bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt      time.Time
	DeletedAt      time.Time      `bun:",soft_delete"`
	Username       string         `bun:",notnull,unique"`
	FullName       string         `bun:",notnull"`
	Email          string         `bun:",unique,notnull"`
	DisplayName    sql.NullString `bun:"type:varchar(200)"`
	FollowedGroups []uuid.UUID    `bun:",type:uuid[],array"`
	OwnerOfGroups  []*UserGroup   `bun:"rel:has-many,join:id=owner_id""`
}

User basic definition of a User and its meta

type UserGroup

type UserGroup struct {
	ID          uuid.UUID `bun:",unique,notnull"`
	CreatedAt   time.Time `bun:",nullzero,notnull,default:current_timestamp"`
	UpdatedAt   time.Time
	DeletedAt   time.Time `bun:",soft_delete"`
	DisplayName string    `bun:",unique,notnull"`
	Description string
	OwnerID     uuid.UUID
	Active      bool `bun:",default:false"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL