models

package
v0.0.0-...-c7806fb Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Photo

type Photo struct {
	gorm.Model
	Path     string `gorm:"type:varchar(255)"`
	ID       uint   `gorm:"primary_key"`
	Title    string `gorm:"type:varchar(100);not null"`
	Caption  string `gorm:"type:varchar(200);not null"`
	PhotoUrl string `gorm:"type:varchar(200);not null"`
	UserID   uint
	User     User `gorm:"foreignKey:UserID"`
}

type User

type User struct {
	gorm.Model
	ID       uint   `gorm:"primary_key"`
	Username string `gorm:"type:varchar(100);not null"`
	Email    string `gorm:"type:varchar(100);unique;not null"`
	Password string `gorm:"type:varchar(100);not null"`
	Photos   []Photo
}

Jump to

Keyboard shortcuts

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