-- Fetch all the Tickets belonging to the Gorgias
-- account of a particular user.
SELECT *
FROM fiber.gorgias_ticket
WHERE account_id = '{user.gorgias_id}'
-- Fetch all the Tickets belonging to the Gorgias
-- account of a particular user.
SELECT *
FROM fiber.gorgias_ticket
WHERE account_id = '{user.gorgias_id}'
Code
CREATE TABLE fiber.gorgias_ticket (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
assignee_user TEXT,
channel TEXT,
closed_datetime TEXT,
created_datetime TEXT,
customer JSONB,
events JSONB,
external_id TEXT,
is_unread BOOLEAN,
language TEXT,
last_message_datetime TEXT,
last_received_message_datetime TEXT,
messages JSONB,
meta JSONB,
opened_datetime TEXT,
satisfaction_survey JSONB,
snooze_datetime TEXT,
spam BOOLEAN,
status TEXT,
subject TEXT,
tags JSONB,
trashed_datetime TEXT,
updated_datetime TEXT,
via TEXT,
uri TEXT
)
CREATE TABLE fiber.gorgias_ticket (
id TEXT NOT NULL,
created_at TIMESTAMP WITH TIME ZONE,
updated_at TIMESTAMP WITH TIME ZONE,
account_id TEXT,
assignee_user TEXT,
channel TEXT,
closed_datetime TEXT,
created_datetime TEXT,
customer JSONB,
events JSONB,
external_id TEXT,
is_unread BOOLEAN,
language TEXT,
last_message_datetime TEXT,
last_received_message_datetime TEXT,
messages JSONB,
meta JSONB,
opened_datetime TEXT,
satisfaction_survey JSONB,
snooze_datetime TEXT,
spam BOOLEAN,
status TEXT,
subject TEXT,
tags JSONB,
trashed_datetime TEXT,
updated_datetime TEXT,
via TEXT,
uri TEXT
)
Model definition