-- Fetch all the Orders belonging to the Faire
-- account of a particular user.
SELECT *
FROM fiber.faire_order
WHERE account_id = '{user.faire_id}'
-- Fetch all the Orders belonging to the Faire
-- account of a particular user.
SELECT *
FROM fiber.faire_order
WHERE account_id = '{user.faire_id}'
Code
CREATE TABLE fiber.faire_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
display_id TEXT,
state TEXT,
address JSONB,
ship_after TEXT,
payout_costs JSONB,
payment_initiated_at TEXT,
retailer_id TEXT,
source TEXT,
expected_ship_date TEXT,
customer JSONB,
processing_at TEXT,
items JSONB,
shipments JSONB,
brand_discounts JSONB
)
CREATE TABLE fiber.faire_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
display_id TEXT,
state TEXT,
address JSONB,
ship_after TEXT,
payout_costs JSONB,
payment_initiated_at TEXT,
retailer_id TEXT,
source TEXT,
expected_ship_date TEXT,
customer JSONB,
processing_at TEXT,
items JSONB,
shipments JSONB,
brand_discounts JSONB
)
Model definition