feat: add orders

This commit is contained in:
yanghao05
2025-04-10 21:42:13 +08:00
parent 5a63eee1ce
commit 8baab46132
20 changed files with 979 additions and 1 deletions

View File

@@ -0,0 +1,26 @@
-- +goose Up
-- +goose StatementBegin
CREATE TABLE orders(
id SERIAL8 PRIMARY KEY,
created_at timestamp NOT NULL DEFAULT now(),
updated_at timestamp NOT NULL DEFAULT now(),
order_no varchar(64) NOT NULL,
sub_order_no varchar(64) NOT NULL DEFAULT '',
transaction_id varchar(64) NOT NULL DEFAULT '',
refund_transaction_id varchar(64) NOT NULL DEFAULT '',
price int8 NOT NULL DEFAULT 0,
discount int2 NOT NULL DEFAULT 100,
currency varchar(10) NOT NULL DEFAULT 'CNY',
payment_method varchar(50) NOT NULL DEFAULT 'wechatpay',
post_id int8 NOT NULL,
user_id int8 NOT NULL,
status int2 NOT NULL,
meta jsonb NOT NULL DEFAULT '{}' ::jsonb
);
-- +goose StatementEnd
-- +goose Down
-- +goose StatementBegin
DROP TABLE orders;
-- +goose StatementEnd