fix column type
This commit is contained in:
parent
3f18f0e1c2
commit
7100a3618f
@ -112,7 +112,7 @@ CREATE TABLE reviews (
|
||||
"comments" text not null,
|
||||
"score" smallint not null,
|
||||
"is_from_critic" boolean not null,
|
||||
"is_hided" boolean, -- if comments violate TOS just hide the reviews
|
||||
"is_hided" boolean not null default(false), -- if comments violate TOS just hide the reviews
|
||||
"location_id" integer references "locations"("id") not null,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
@ -121,7 +121,8 @@ CREATE TABLE reviews (
|
||||
CREATE TYPE comment_type AS ENUM(
|
||||
'stories',
|
||||
'news',
|
||||
'reviews'
|
||||
'reviews',
|
||||
'locations'
|
||||
);
|
||||
|
||||
CREATE TABLE comments(
|
||||
|
@ -19,6 +19,7 @@ const (
|
||||
CommentTypeStories CommentType = "stories"
|
||||
CommentTypeNews CommentType = "news"
|
||||
CommentTypeReviews CommentType = "reviews"
|
||||
CommentTypeLocations CommentType = "locations"
|
||||
)
|
||||
|
||||
func (e *CommentType) Scan(src interface{}) error {
|
||||
@ -188,7 +189,7 @@ type Review struct {
|
||||
Comments string `json:"comments"`
|
||||
Score int16 `json:"score"`
|
||||
IsFromCritic bool `json:"is_from_critic"`
|
||||
IsHided sql.NullBool `json:"is_hided"`
|
||||
IsHided bool `json:"is_hided"`
|
||||
LocationID int32 `json:"location_id"`
|
||||
CreatedAt sql.NullTime `json:"created_at"`
|
||||
UpdatedAt sql.NullTime `json:"updated_at"`
|
||||
|
Loading…
Reference in New Issue
Block a user