hiling_go/db/sqlc/models.go

329 lines
10 KiB
Go
Raw Permalink Normal View History

2023-09-08 22:24:58 +07:00
// Code generated by sqlc. DO NOT EDIT.
// versions:
2024-02-06 11:55:25 +07:00
// sqlc v1.25.0
2023-09-08 22:24:58 +07:00
package db
import (
2023-09-12 17:07:03 +07:00
"database/sql/driver"
"fmt"
2023-09-08 22:24:58 +07:00
2024-02-06 11:55:25 +07:00
"github.com/jackc/pgx/v5/pgtype"
2023-09-08 22:24:58 +07:00
)
2023-09-12 17:07:03 +07:00
type CommentType string
const (
2023-09-24 15:01:46 +07:00
CommentTypeStories CommentType = "stories"
CommentTypeNews CommentType = "news"
CommentTypeReviews CommentType = "reviews"
CommentTypeLocations CommentType = "locations"
2023-09-12 17:07:03 +07:00
)
func (e *CommentType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = CommentType(s)
case string:
*e = CommentType(s)
default:
return fmt.Errorf("unsupported scan type for CommentType: %T", src)
}
return nil
}
type NullCommentType struct {
CommentType CommentType `json:"comment_type"`
Valid bool `json:"valid"` // Valid is true if CommentType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullCommentType) Scan(value interface{}) error {
if value == nil {
ns.CommentType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.CommentType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullCommentType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.CommentType), nil
}
2023-10-02 08:49:41 +07:00
type LocationType string
const (
LocationTypeBeach LocationType = "beach"
LocationTypeAmusementpark LocationType = "amusement park"
LocationTypeCulinary LocationType = "culinary"
LocationTypeHikingCamping LocationType = "hiking / camping"
LocationTypeOther LocationType = "other"
)
func (e *LocationType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = LocationType(s)
case string:
*e = LocationType(s)
default:
return fmt.Errorf("unsupported scan type for LocationType: %T", src)
}
return nil
}
type NullLocationType struct {
LocationType LocationType `json:"location_type"`
Valid bool `json:"valid"` // Valid is true if LocationType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullLocationType) Scan(value interface{}) error {
if value == nil {
ns.LocationType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.LocationType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullLocationType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.LocationType), nil
}
2023-09-12 17:07:03 +07:00
type UserReportsType string
const (
UserReportsTypeComments UserReportsType = "comments"
UserReportsTypeReviews UserReportsType = "reviews"
UserReportsTypeLocations UserReportsType = "locations"
UserReportsTypeUsers UserReportsType = "users"
UserReportsTypeStories UserReportsType = "stories"
)
func (e *UserReportsType) Scan(src interface{}) error {
switch s := src.(type) {
case []byte:
*e = UserReportsType(s)
case string:
*e = UserReportsType(s)
default:
return fmt.Errorf("unsupported scan type for UserReportsType: %T", src)
}
return nil
}
type NullUserReportsType struct {
UserReportsType UserReportsType `json:"user_reports_type"`
Valid bool `json:"valid"` // Valid is true if UserReportsType is not NULL
}
// Scan implements the Scanner interface.
func (ns *NullUserReportsType) Scan(value interface{}) error {
if value == nil {
ns.UserReportsType, ns.Valid = "", false
return nil
}
ns.Valid = true
return ns.UserReportsType.Scan(value)
}
// Value implements the driver Valuer interface.
func (ns NullUserReportsType) Value() (driver.Value, error) {
if !ns.Valid {
return nil, nil
}
return string(ns.UserReportsType), nil
}
type ClientIp struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Ipv4 string `json:"ipv4"`
Ipv6 pgtype.Text `json:"ipv6"`
BannedAt pgtype.Timestamp `json:"banned_at"`
BannedUntil pgtype.Timestamp `json:"banned_until"`
Reason pgtype.Text `json:"reason"`
IsPermaban pgtype.Bool `json:"is_permaban"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-12 17:07:03 +07:00
}
type Comment struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
SubmittedBy int32 `json:"submitted_by"`
CommentOn int32 `json:"comment_on"`
CommentType CommentType `json:"comment_type"`
ReplyTo pgtype.Int4 `json:"reply_to"`
IsHide pgtype.Bool `json:"is_hide"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-12 17:07:03 +07:00
}
2023-09-19 21:49:48 +07:00
type Image struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
ImageUrl string `json:"image_url"`
UploadedBy int32 `json:"uploaded_by"`
ImageType string `json:"image_type"`
ImageOf int32 `json:"image_of"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-19 21:49:48 +07:00
}
2023-09-08 22:24:58 +07:00
type Location struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Address string `json:"address"`
Name string `json:"name"`
GoogleMapsLink pgtype.Text `json:"google_maps_link"`
LocationType LocationType `json:"location_type"`
SubmittedBy int32 `json:"submitted_by"`
TotalVisited pgtype.Int4 `json:"total_visited"`
Thumbnail pgtype.Text `json:"thumbnail"`
RegencyID int16 `json:"regency_id"`
IsDeleted bool `json:"is_deleted"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
ApprovedAt pgtype.Timestamp `json:"approved_at"`
2023-09-08 22:24:58 +07:00
}
type LocationImage struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Url string `json:"url"`
LocationID int32 `json:"location_id"`
UploadedBy pgtype.Int4 `json:"uploaded_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-08 22:24:58 +07:00
}
2023-10-11 16:31:52 +07:00
type NewsEvent struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Title string `json:"title"`
Url string `json:"url"`
Source string `json:"source"`
Thumbnail pgtype.Text `json:"thumbnail"`
Description pgtype.Text `json:"description"`
IsDeleted bool `json:"is_deleted"`
SubmittedBy int32 `json:"submitted_by"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-10-11 16:31:52 +07:00
}
2023-09-08 22:24:58 +07:00
type Province struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
ProvinceName string `json:"province_name"`
RegionID int16 `json:"region_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-08 22:24:58 +07:00
}
type Regency struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
RegencyName string `json:"regency_name"`
ProvinceID int16 `json:"province_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-08 22:24:58 +07:00
}
type Region struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
RegionName string `json:"region_name"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-08 22:24:58 +07:00
}
type Review struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
SubmittedBy int32 `json:"submitted_by"`
Comments string `json:"comments"`
Score int16 `json:"score"`
IsFromCritic bool `json:"is_from_critic"`
CostApprox pgtype.Int4 `json:"cost_approx"`
IsHided bool `json:"is_hided"`
LocationID int32 `json:"location_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-08 22:24:58 +07:00
}
type Tag struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Name string `json:"name"`
SubmittedBy int32 `json:"submitted_by"`
TargetID int32 `json:"target_id"`
TagsType string `json:"tags_type"`
ApprovedBy pgtype.Int4 `json:"approved_by"`
2023-09-08 22:24:58 +07:00
}
type User struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Email pgtype.Text `json:"email"`
Username string `json:"username"`
Password string `json:"password"`
AvatarPicture pgtype.Text `json:"avatar_picture"`
GoogleSignInPayload pgtype.Text `json:"google_sign_in_payload"`
BannedAt pgtype.Timestamp `json:"banned_at"`
BannedUntil pgtype.Timestamp `json:"banned_until"`
BanReason pgtype.Text `json:"ban_reason"`
IsPermaban pgtype.Bool `json:"is_permaban"`
IsAdmin pgtype.Bool `json:"is_admin"`
IsCritics pgtype.Bool `json:"is_critics"`
IsVerified pgtype.Bool `json:"is_verified"`
IsActive pgtype.Bool `json:"is_active"`
SocialMedia []byte `json:"social_media"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
About pgtype.Text `json:"about"`
Website pgtype.Text `json:"website"`
2023-09-08 22:24:58 +07:00
}
2023-09-12 17:07:03 +07:00
2023-09-19 21:49:48 +07:00
type UserActivity struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
TargetID int32 `json:"target_id"`
Target string `json:"target"`
Action string `json:"action"`
Link pgtype.Text `json:"link"`
Comment pgtype.Text `json:"comment"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-19 21:49:48 +07:00
}
2023-10-03 16:14:58 +07:00
type UserFollow struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
FollowerID int32 `json:"follower_id"`
FolloweeID int32 `json:"followee_id"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-10-03 16:14:58 +07:00
}
2023-09-12 17:07:03 +07:00
type UserReport struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
Message string `json:"message"`
Date pgtype.Timestamp `json:"date"`
ReportTarget int32 `json:"report_target"`
ReportType UserReportsType `json:"report_type"`
SubmittedBy int32 `json:"submitted_by"`
CreatedAt pgtype.Timestamp `json:"created_at"`
UpdatedAt pgtype.Timestamp `json:"updated_at"`
2023-09-12 17:07:03 +07:00
}
2023-09-21 21:38:41 +07:00
type UserSession struct {
2024-02-06 11:55:25 +07:00
ID int32 `json:"id"`
IndexID int64 `json:"index_id"`
Username string `json:"username"`
RefreshToken string `json:"refresh_token"`
UserAgent string `json:"user_agent"`
ClientIp string `json:"client_ip"`
IsBlocked bool `json:"is_blocked"`
ExpiresAt pgtype.Timestamp `json:"expires_at"`
CreatedAt pgtype.Timestamp `json:"created_at"`
2023-09-21 21:38:41 +07:00
}