database

package
v0.0.0-...-b6d6674 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseModel

type BaseModel struct {
	gorm.Model
	ID        uuid.UUID `gorm:"column:id;type:uuid;primary_key;not null"`
	CreatedAt time.Time `gorm:"column:created_at;type:datetime;not null"`
	UpdatedAt time.Time `gorm:"column:updated_at;type:datetime;not null"`
	DeletedAt gorm.DeletedAt
}

BaseModel contains common columns for all tables.

func (*BaseModel) BeforeCreate

func (base *BaseModel) BeforeCreate(db *gorm.DB) error

BeforeCreate will set a UUID rather than numeric ID.

Jump to

Keyboard shortcuts

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