-- Fetch all the Subscriptions belonging to the
-- Chargebee account of a particular user.
SELECT *
FROM fiber.chargebee_subscription
WHERE account_id = '{user.chargebee_id}'
-- Fetch all the Subscriptions belonging to the
-- Chargebee account of a particular user.
SELECT *
FROM fiber.chargebee_subscription
WHERE account_id = '{user.chargebee_id}'
Code
CREATE TABLE fiber.chargebee_subscription (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
activated_at TIMESTAMP WITH TIME ZONE,
billing_period INT,
billing_period_unit TEXT,
currency_code TEXT,
current_term_end INT,
current_term_start INT,
customer_id TEXT,
deleted BOOLEAN,
due_invoices_count INT,
due_since INT,
has_scheduled_changes BOOLEAN,
id TEXT,
mrr DOUBLE PRECISION,
next_billing_at TIMESTAMP WITH TIME ZONE,
object TEXT,
remaining_billing_cycles INT,
resource_version INT,
started_at TIMESTAMP WITH TIME ZONE,
status TEXT,
subscription_items JSONB,
total_dues DOUBLE PRECISION
)
CREATE TABLE fiber.chargebee_subscription (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
activated_at TIMESTAMP WITH TIME ZONE,
billing_period INT,
billing_period_unit TEXT,
currency_code TEXT,
current_term_end INT,
current_term_start INT,
customer_id TEXT,
deleted BOOLEAN,
due_invoices_count INT,
due_since INT,
has_scheduled_changes BOOLEAN,
id TEXT,
mrr DOUBLE PRECISION,
next_billing_at TIMESTAMP WITH TIME ZONE,
object TEXT,
remaining_billing_cycles INT,
resource_version INT,
started_at TIMESTAMP WITH TIME ZONE,
status TEXT,
subscription_items JSONB,
total_dues DOUBLE PRECISION
)
Model definition