-- Fetch all the Deals belonging to the Pipedrive
-- account of a particular user.
SELECT *
FROM fiber.pipedrive_deal
WHERE account_id = '{user.pipedrive_id}'
-- Fetch all the Deals belonging to the Pipedrive
-- account of a particular user.
SELECT *
FROM fiber.pipedrive_deal
WHERE account_id = '{user.pipedrive_id}'
Code
CREATE TABLE fiber.pipedrive_deal (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
stage_id TEXT,
title TEXT,
value INT,
currency TEXT,
add_time TIMESTAMP WITH TIME ZONE,
update_time TIMESTAMP WITH TIME ZONE,
stage_change_time TIMESTAMP WITH TIME ZONE,
active BOOLEAN,
deleted BOOLEAN,
status TEXT,
probability DOUBLE PRECISION,
next_activity_date TIMESTAMP WITH TIME ZONE,
next_activity_time TEXT,
next_activity_id TEXT,
last_activity_id TEXT,
last_activity_date TIMESTAMP WITH TIME ZONE,
lost_reason TEXT,
visible_to TEXT,
close_time TIMESTAMP WITH TIME ZONE,
pipeline_id TEXT,
won_time TEXT,
first_won_time TEXT,
lost_time TEXT,
products_count INT,
files_count INT,
notes_count INT,
followers_count INT,
email_messages_count INT,
activities_count INT,
done_activities_count INT,
undone_activities_count INT,
participants_count INT,
expected_close_date TEXT,
last_incoming_mail_time TEXT,
last_outgoing_mail_time TEXT,
label TEXT,
stage_order_nr INT,
person_name TEXT,
org_name TEXT,
next_activity_subject TEXT,
next_activity_type TEXT,
next_activity_duration TEXT,
next_activity_note TEXT,
formatted_value TEXT,
weighted_value DOUBLE PRECISION,
formatted_weighted_value TEXT,
weighted_value_currency TEXT,
rotten_time TIMESTAMP WITH TIME ZONE,
owner_name TEXT,
cc_email TEXT,
org_hidden BOOLEAN,
person_hidden BOOLEAN
)
CREATE TABLE fiber.pipedrive_deal (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
stage_id TEXT,
title TEXT,
value INT,
currency TEXT,
add_time TIMESTAMP WITH TIME ZONE,
update_time TIMESTAMP WITH TIME ZONE,
stage_change_time TIMESTAMP WITH TIME ZONE,
active BOOLEAN,
deleted BOOLEAN,
status TEXT,
probability DOUBLE PRECISION,
next_activity_date TIMESTAMP WITH TIME ZONE,
next_activity_time TEXT,
next_activity_id TEXT,
last_activity_id TEXT,
last_activity_date TIMESTAMP WITH TIME ZONE,
lost_reason TEXT,
visible_to TEXT,
close_time TIMESTAMP WITH TIME ZONE,
pipeline_id TEXT,
won_time TEXT,
first_won_time TEXT,
lost_time TEXT,
products_count INT,
files_count INT,
notes_count INT,
followers_count INT,
email_messages_count INT,
activities_count INT,
done_activities_count INT,
undone_activities_count INT,
participants_count INT,
expected_close_date TEXT,
last_incoming_mail_time TEXT,
last_outgoing_mail_time TEXT,
label TEXT,
stage_order_nr INT,
person_name TEXT,
org_name TEXT,
next_activity_subject TEXT,
next_activity_type TEXT,
next_activity_duration TEXT,
next_activity_note TEXT,
formatted_value TEXT,
weighted_value DOUBLE PRECISION,
formatted_weighted_value TEXT,
weighted_value_currency TEXT,
rotten_time TIMESTAMP WITH TIME ZONE,
owner_name TEXT,
cc_email TEXT,
org_hidden BOOLEAN,
person_hidden BOOLEAN
)
Model definition