fix: issues

This commit is contained in:
Rogee
2025-01-14 19:48:23 +08:00
parent b429f30916
commit 48a0a6c195
14 changed files with 1037 additions and 195 deletions

View File

@@ -8,16 +8,17 @@ CREATE TABLE
updated_at timestamp NOT NULL default now(),
deleted_at timestamp,
type INT2 NOT NULL default 0,
stage INT2 NOT NULL default 0,
status INT2 NOT NULL default 0,
tenant_id INT8 NOT NULL,
user_id INT8 NOT NULL,
hash VARCHAR(128) NOT NULL UNIQUE,
title VARCHAR(128) NOT NULL,
description VARCHAR(256) NOT NULL,
poster VARCHAR(128) NOT NULL,
poster_asset_id INT8 NOT NULL,
content TEXT NOT NULL,
stage INT2 NOT NULL default 0,
status INT2 NOT NULL default 0,
price INT8 NOT NULL default 0,
discount INT2 NOT NULL default 100,
views INT8 NOT NULL default 0,
@@ -26,6 +27,7 @@ CREATE TABLE
assets jsonb default '{}'::jsonb
);
-- create indexes
CREATE INDEX posts_type_index ON posts (type);
CREATE INDEX posts_tenant_id_index ON posts (tenant_id);
CREATE INDEX posts_user_id_index ON posts (user_id);
CREATE INDEX posts_title_index ON posts (title);
@@ -55,4 +57,5 @@ CREATE INDEX user_bought_posts_post_id_index ON user_bought_posts (post_id);
-- +goose Down
-- +goose StatementBegin
DROP TABLE posts;
DROP TABLE user_bought_posts;
-- +goose StatementEnd