-- +goose Up
-- +goose StatementBegin
-- create posts table
CREATE TABLE
    posts (
        id SERIAL8 PRIMARY KEY,
        created_at timestamp NOT NULL default now(),
        updated_at timestamp NOT NULL default now(),
        deleted_at timestamp,

        tenant_id INT8 NOT NULL,
        user_id INT8 NOT NULL,

        hash_id VARCHAR(128) NOT NULL,
        title VARCHAR(128) NOT NULL,
        description VARCHAR(256) NOT NULL,
        poster VARCHAR(128) 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,
        likes INT8 NOT NULL default 0,
        meta jsonb default '{}'::jsonb,
        assets jsonb default '{}'::jsonb
    );
-- +goose StatementEnd

-- +goose Down
-- +goose StatementBegin
DROP TABLE posts;
-- +goose StatementEnd
