feat: add medias
This commit is contained in:
@@ -2,3 +2,6 @@ ignores: [] # ignore tables
|
||||
types:
|
||||
users: # table name
|
||||
oauth: backend/pkg/pg.UserOAuth
|
||||
|
||||
media_resources: # table name
|
||||
type: backend/pkg/pg.MediaType
|
||||
|
||||
@@ -72,7 +72,7 @@ CREATE TABLE
|
||||
title VARCHAR(198) NOT NULL,
|
||||
description VARCHAR(198) NOT NULL,
|
||||
price INT8 NOT NULL,
|
||||
discount INT8 NOT NULL,
|
||||
discount INT8 NOT NULL default 100,
|
||||
publish BOOL NOT NULL,
|
||||
created_at timestamp NOT NULL default now(),
|
||||
updated_at timestamp NOT NULL default now()
|
||||
|
||||
@@ -8,16 +8,17 @@
|
||||
package model
|
||||
|
||||
import (
|
||||
"backend/pkg/pg"
|
||||
"time"
|
||||
)
|
||||
|
||||
type MediaResources struct {
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
MediaID int64 `json:"media_id"`
|
||||
Type string `json:"type"`
|
||||
Source *string `json:"source"`
|
||||
Size int64 `json:"size"`
|
||||
Publish bool `json:"publish"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
ID int64 `sql:"primary_key" json:"id"`
|
||||
MediaID int64 `json:"media_id"`
|
||||
Type pg.MediaType `json:"type"`
|
||||
Source *string `json:"source"`
|
||||
Size int64 `json:"size"`
|
||||
Publish bool `json:"publish"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user