feat: add orders
This commit is contained in:
26
backend/database/migrations/20250410130530_create_orders.sql
Normal file
26
backend/database/migrations/20250410130530_create_orders.sql
Normal 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
|
||||
Reference in New Issue
Block a user