-- Fetch all the Leads belonging to the Close account
-- of a particular user.
SELECT *
FROM fiber.close_lead
WHERE account_id = '{user.close_id}'
-- Fetch all the Leads belonging to the Close account
-- of a particular user.
SELECT *
FROM fiber.close_lead
WHERE account_id = '{user.close_id}'
Code
CREATE TABLE fiber.close_lead (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
status_id TEXT,
status_label TEXT,
tasks JSONB,
display_name TEXT,
addresses JSONB,
name TEXT,
contacts JSONB,
custom JSONB,
date_updated TEXT,
html_url TEXT,
created_by JSONB,
organization_id TEXT,
url TEXT,
opportunities JSONB,
updated_by TEXT,
date_created TEXT,
id TEXT,
description TEXT
)
CREATE TABLE fiber.close_lead (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
status_id TEXT,
status_label TEXT,
tasks JSONB,
display_name TEXT,
addresses JSONB,
name TEXT,
contacts JSONB,
custom JSONB,
date_updated TEXT,
html_url TEXT,
created_by JSONB,
organization_id TEXT,
url TEXT,
opportunities JSONB,
updated_by TEXT,
date_created TEXT,
id TEXT,
description TEXT
)
Model definition