models

package
v0.0.0-...-e3bfd3d Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBMigrate

func DBMigrate(db *gorm.DB) *gorm.DB

The DBMigrate function takes a GORM database instance (db) and uses the AutoMigrate method to automatically create the necessary table(s) and migrate the schema to match the struct. This ensures that the database schema is up-to-date with the latest changes in the model.

Types

type Event

type Event struct {

	// The gorm.Model is a struct provided by the GORM library that
	// contains common fields used for most database tables.
	// By embedding gorm.Model in the User struct, the fields ID,
	// CreatedAt, UpdatedAt, and DeletedAt are added to the User struct
	// automatically.
	gorm.Model
	Name      string `json:"name"`
	Date      string `json:"date"`
	Time      string `json:"time"`
	Location  string `json:"location"`
	Interests string `json:"interests"`
}

Struct that defines the fields that represent a user in the application

type User

type User struct {

	// The gorm.Model is a struct provided by the GORM library that
	// contains common fields used for most database tables.
	// By embedding gorm.Model in the User struct, the fields ID,
	// CreatedAt, UpdatedAt, and DeletedAt are added to the User struct
	// automatically.
	gorm.Model
	Username           string `json:"username"`
	Passwordhash       string `json:"passwordhash"`
	Firstname          string `json:"firstname"`
	Lastname           string `json:"lastname"`
	Email              string `json:"email"`
	ProfilePicturePath string `json:"profilepicturepath"`
	// Text               []string `json:"text"`
	// ConfidenceLevel    []int    `json:"confidencelevel"`
	AudioPath string `json:"audiopath"`
}

Struct that defines the fields that represent a user in the application

Jump to

Keyboard shortcuts

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