models

package
v0.0.0-...-727d710 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConnectDatabase

func ConnectDatabase(sqlurl string) *gorm.DB

Types

type Area

type Area struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type Country

type Country struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type Fees

type Fees struct {
	ID       int64  `json:"id" gorm:"primary_key"`
	MovieID  int64  `json:"movie_id"`
	Value    int64  `json:"value"`
	Currency string `json:"currency"`
	AreaID   int64  `json:"-"`
	Movie    Movie  `json:"-"`
	Area     Area   `json:"area"`
}

type Genre

type Genre struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type Movie

type Movie struct {
	ID              int64     `json:"id" gorm:"primary_key"`
	ExternalID      int64     `json:"external_id"`
	MovieTypeID     int64     `json:"movie_type_id"`
	Name            string    `json:"name" gorm:"index:,class:FULLTEXT"`
	AlternativeName string    `json:"alternative_name" gorm:"index:,class:FULLTEXT"`
	Description     string    `json:"description"`
	Year            int64     `json:"year" gorm:"index:,sort:desc,type:btree"`
	StatusID        int64     `json:"status_id"`
	Duration        int64     `json:"duration"`
	Score           float32   `json:"score" gorm:"precision:3;index:,sort:desc,type:btree"`
	Votes           int64     `json:"votes"`
	AgeRating       int64     `json:"age_rating"`
	CountryID       int64     `json:"country_id"`
	Status          Status    `json:"-"`
	MovieType       MovieType `json:"-"`
	Country         Country   `json:"-"`
}

type MovieGenres

type MovieGenres struct {
	ID      int64 `json:"id" gorm:"primary_key"`
	GenreID int64 `json:"genre_id"`
	MovieID int64 `json:"movie_id"`
	Genre   Genre `json:"-"`
	Movie   Movie `json:"-"`
}

type MovieType

type MovieType struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type Person

type Person struct {
	ID     int64  `json:"id" gorm:"primary_key"`
	Name   string `json:"name"`
	NameEn string `json:"name_en"`
}

type PersonInMovie

type PersonInMovie struct {
	ID           int64      `json:"id" gorm:"primary_key"`
	MovieID      int64      `json:"movie_id"`
	PersonID     int64      `json:"person_id"`
	ProfessionID int64      `json:"profession_id"`
	Person       Person     `json:"-"`
	Profession   Profession `json:"-"`
	Movie        Movie      `json:"-"`
}

type PersonalRating

type PersonalRating struct {
	ID      int64 `json:"id" gorm:"primary_key"`
	MovieID int64 `json:"movie_id"`
	UserID  int64 `json:"user_id"`
	Score   int64 `json:"score"`
	User    User  `json:"-"`
	Movie   Movie `json:"-"`
}

type Poster

type Poster struct {
	ID           int64      `json:"id" gorm:"primary_key"`
	Url          string     `json:"url"`
	MovieID      int64      `json:"movie_id"`
	PosterTypeID int64      `json:"poster_type_id"`
	Movie        Movie      `json:"-"`
	PosterType   PosterType `json:"-"`
}

type PosterType

type PosterType struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type Profession

type Profession struct {
	ID     int64  `json:"id" gorm:"primary_key"`
	NameEn string `json:"name_en" gorm:"unique"`
}

type Status

type Status struct {
	ID   int64  `json:"id" gorm:"primary_key"`
	Name string `json:"name" gorm:"unique"`
}

type User

type User struct {
	Id      int64  `json:"id" gorm:"primary_key"`
	Email   string `json:"email"`
	Pass    string `json:"pass"`
	Created int64  `gorm:"autoCreateTime"`
}

Jump to

Keyboard shortcuts

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