dbmodels

package
v0.0.0-...-1ccafed Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Base

type Base struct {
	ID        uuid.UUID `json:"_id" gorm:"primaryKey;autoIncrement:false"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
}

Base contains common columns for all tables

func (*Base) AfterUpdate

func (base *Base) AfterUpdate(tx *gorm.DB) error

AfterUpdate will update the Base struct after every update

func (*Base) BeforeCreate

func (base *Base) BeforeCreate(tx *gorm.DB) error

BeforeCreate will set Base struct before every insert

type FcmToken

type FcmToken struct {
	Base
	FcmToken string `json:"fcm_token" gorm:"index:fcm_token_index,unique"`
	Account  string `json:"account" gorm:"index:fcm_token_index,unique"`
}

Store FCM tokens in database for push notifications

Jump to

Keyboard shortcuts

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