datamodel

package
v0.1.2-alpha Latest Latest
Warning

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

Go to latest
Published: May 31, 2022 License: Apache-2.0 Imports: 4 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 {
	UID        uuid.UUID      `gorm:"type:uuid;primary_key;<-:create"` // allow read and create
	CreateTime time.Time      `gorm:"autoCreateTime:nano"`
	UpdateTime time.Time      `gorm:"autoUpdateTime:nano"`
	DeleteTime gorm.DeletedAt `sql:"index"`
}

Base contains common columns for all tables

type User

type User struct {
	Base
	ID                     string `gorm:"unique;not null;"`
	Email                  sql.NullString
	CompanyName            sql.NullString
	Role                   sql.NullString
	UsageDataCollection    bool `gorm:"default:false"`
	NewsletterSubscription bool `gorm:"default:false"`
}

User defines a user instance in the database

Jump to

Keyboard shortcuts

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