-- Fetch all the Orders belonging to the Checkout
-- Champ account of a particular user.
SELECT *
FROM fiber.checkout_champ_order
WHERE account_id = '{user.checkout_champ_id}'
-- Fetch all the Orders belonging to the Checkout
-- Champ account of a particular user.
SELECT *
FROM fiber.checkout_champ_order
WHERE account_id = '{user.checkout_champ_id}'
Code
CREATE TABLE fiber.checkout_champ_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
order_id TEXT,
actual_order_id TEXT,
external_order_id TEXT,
client_order_id TEXT,
date_created TEXT,
date_updated TEXT,
ship_carrier TEXT,
ship_method TEXT,
order_type TEXT,
order_status TEXT,
review_status TEXT,
total_amount TEXT,
refund_remaining TEXT,
avs_response TEXT,
cvv_response TEXT,
campaign_name TEXT,
customer_id TEXT,
name TEXT,
email_address TEXT,
phone_number TEXT,
first_name TEXT,
last_name TEXT,
company_name TEXT,
address_1 TEXT,
address_2 TEXT,
city TEXT,
state TEXT,
country TEXT,
postal_code TEXT,
ship_first_name TEXT,
ship_last_name TEXT,
ship_company_name TEXT,
ship_address_1 TEXT,
ship_address_2 TEXT,
ship_city TEXT,
ship_state TEXT,
ship_country TEXT,
ship_postal_code TEXT,
pay_source TEXT,
card_type TEXT,
card_last_4 TEXT,
card_expiry_date TEXT,
card_is_prepaid DOUBLE PRECISION,
card_is_debit BOOLEAN,
ach_routing_number TEXT,
ach_account_number TEXT,
coupon_code TEXT,
agent_user_id TEXT,
agent_name TEXT,
price TEXT,
base_shipping TEXT,
voice_log_number TEXT,
discount_price TEXT,
sales_tax TEXT,
surcharge TEXT,
ship_upcharge TEXT,
ship_profile_id TEXT,
is_decline_save BOOLEAN,
ip_address TEXT,
source_id TEXT,
source_title TEXT,
aff_id TEXT,
source_value_1 TEXT,
source_value_2 TEXT,
source_value_3 TEXT,
source_value_4 TEXT,
source_value_5 TEXT,
currency_symbol TEXT,
currency_code TEXT,
campaign_id TEXT,
total_discount TEXT,
product_cost TEXT,
shipping_cost TEXT,
custom_1 TEXT,
custom_2 TEXT,
custom_3 TEXT,
custom_4 TEXT,
custom_5 TEXT,
utm_source TEXT,
utm_medium TEXT,
utm_campaign TEXT,
utm_term TEXT,
utm_content TEXT,
has_upsell BOOLEAN,
items JSONB,
fulfillments JSONB
)
CREATE TABLE fiber.checkout_champ_order (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
order_id TEXT,
actual_order_id TEXT,
external_order_id TEXT,
client_order_id TEXT,
date_created TEXT,
date_updated TEXT,
ship_carrier TEXT,
ship_method TEXT,
order_type TEXT,
order_status TEXT,
review_status TEXT,
total_amount TEXT,
refund_remaining TEXT,
avs_response TEXT,
cvv_response TEXT,
campaign_name TEXT,
customer_id TEXT,
name TEXT,
email_address TEXT,
phone_number TEXT,
first_name TEXT,
last_name TEXT,
company_name TEXT,
address_1 TEXT,
address_2 TEXT,
city TEXT,
state TEXT,
country TEXT,
postal_code TEXT,
ship_first_name TEXT,
ship_last_name TEXT,
ship_company_name TEXT,
ship_address_1 TEXT,
ship_address_2 TEXT,
ship_city TEXT,
ship_state TEXT,
ship_country TEXT,
ship_postal_code TEXT,
pay_source TEXT,
card_type TEXT,
card_last_4 TEXT,
card_expiry_date TEXT,
card_is_prepaid DOUBLE PRECISION,
card_is_debit BOOLEAN,
ach_routing_number TEXT,
ach_account_number TEXT,
coupon_code TEXT,
agent_user_id TEXT,
agent_name TEXT,
price TEXT,
base_shipping TEXT,
voice_log_number TEXT,
discount_price TEXT,
sales_tax TEXT,
surcharge TEXT,
ship_upcharge TEXT,
ship_profile_id TEXT,
is_decline_save BOOLEAN,
ip_address TEXT,
source_id TEXT,
source_title TEXT,
aff_id TEXT,
source_value_1 TEXT,
source_value_2 TEXT,
source_value_3 TEXT,
source_value_4 TEXT,
source_value_5 TEXT,
currency_symbol TEXT,
currency_code TEXT,
campaign_id TEXT,
total_discount TEXT,
product_cost TEXT,
shipping_cost TEXT,
custom_1 TEXT,
custom_2 TEXT,
custom_3 TEXT,
custom_4 TEXT,
custom_5 TEXT,
utm_source TEXT,
utm_medium TEXT,
utm_campaign TEXT,
utm_term TEXT,
utm_content TEXT,
has_upsell BOOLEAN,
items JSONB,
fulfillments JSONB
)
Model definition