models

package
v0.0.0-...-17df326 Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2019 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 Follow

type Follow struct {
	gorm.Model
	FollowingID  uint `gorm:"primary_key" sql:"type:int not null"`
	FollowedByID uint `gorm:"primary_key" sql:"type:int not null"`
}

Follow - jon is folowwing susan FollowedByID-jon FollowingID-susan

type User

type User struct {
	gorm.Model
	Username          string `gorm:"unique_index;not null"`
	Email             string `gorm:"unique_index;not null"`
	Password          string `gorm:"-"`
	PasswordHash      string `gorm:"not null"`
	RememberToken     string `gorm:"-"`
	RememberTokenHash string `gorm:"unique_index;not null"`
	Bio               string
	Image             string
	Followers         []Follow `gorm:"foreignkey:FollowingID"`
	Followings        []Follow `gorm:"foreignkey:FollowedByID"`
}

User model represented in db

Jump to

Keyboard shortcuts

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