entity

package
v0.0.0-...-730913c Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2024 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 Blog

type Blog struct {
	gorm.Model
	ID      int64  `gorm:"primaryKey;unique;not null"`
	Content string `gorm:"not null;type:varchar(500)"`
	User_ID string `gorm:"not null"`
	User    User   `gorm:"ForeignKey:User_ID"`
}

type Comment

type Comment struct {
	gorm.Model
	ID      int64  `gorm:"primaryKey;unique;not null"`
	Content string `gorm:"not null;type:varchar(100)"`
	User_ID string `gorm:"not null"`
	Blog_ID int    `gorm:"not null"`
	User    User   `gorm:"ForeignKey:User_ID"`
	Blog    Blog   `gorm:"ForeignKey:Blog_ID"`
}

type User

type User struct {
	gorm.Model
	ID       int64  //only because of gorm
	Username string `gorm:"primaryKey;unique;not null;type:varchar(15)"`
	Pw       string
}

Jump to

Keyboard shortcuts

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