返回 CodeWhale
0001_merch.sql
根目录 / web / migrations / merch / 0001_merch.sql
1 -- Separate commerce database: do not apply to the community KV or product balances.
2 CREATE TABLE IF NOT EXISTS merch_orders (
3 id TEXT PRIMARY KEY,
4 quote_json TEXT NOT NULL,
5 expires_at INTEGER NOT NULL,
6 stripe_session_id TEXT UNIQUE,
7 checkout_url TEXT,
8 payment_state TEXT NOT NULL DEFAULT 'quoted',
9 fulfillment_state TEXT NOT NULL DEFAULT 'not_ready',
10 supplier_order_id TEXT UNIQUE,
11 supplier_receipt_json TEXT,
12 tracking_json TEXT,
13 updated_at INTEGER NOT NULL
14 );
15 CREATE TABLE IF NOT EXISTS merch_webhook_events (
16 id TEXT PRIMARY KEY,
17 order_id TEXT NOT NULL REFERENCES merch_orders(id),
18 kind TEXT NOT NULL,
19 received_at INTEGER NOT NULL
20 );
21
21 lines SQL