 CREATE TABLE IF NOT EXISTS payments (
     id         BIGSERIAL    PRIMARY KEY,
     order_id   BIGINT       NOT NULL REFERENCES orders(id),
     amount     NUMERIC(12,2) NOT NULL,
     method     VARCHAR(20)  NOT NULL DEFAULT 'wechat',
     status     VARCHAR(20)  NOT NULL DEFAULT 'pending',
     created_at TIMESTAMP    NOT NULL DEFAULT NOW()
 );
 
 CREATE INDEX idx_payments_order_id ON payments(order_id);
