-- ======================
-- MESSAGING: Channel
-- ======================
CREATE TABLE "unified_messaging_channel" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "parent_id"              VARCHAR,
  "has_subchannels"        BOOLEAN,
  "members"                VARIANT,
  "is_active"              BOOLEAN,
  "is_private"             BOOLEAN,
  "web_url"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- MESSAGING: Message
-- ======================
CREATE TABLE "unified_messaging_message" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "channel_id"             VARCHAR,
  "channel_ids"            VARIANT,
  "channels"               VARIANT,
  "parent_id"              VARCHAR,
  "root_message_id"        VARCHAR,
  "message_thread_identifier" VARCHAR,
  "author_member"          VARIANT,
  "destination_members"    VARIANT,
  "hidden_members"         VARIANT,
  "mentioned_members"      VARIANT,
  "reactions"              VARIANT,
  "subject"                VARCHAR,
  "message"                VARCHAR,
  "message_html"           VARCHAR,
  "message_markdown"       VARCHAR,
  "attachments"            VARIANT,
  "web_url"                VARCHAR,
  "reference"              VARCHAR,
  "has_children"           BOOLEAN,
  "is_unread"              BOOLEAN,
  "buttons"                VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Deal
-- ======================
CREATE TABLE "unified_crm_deal" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "amount"                 FLOAT,
  "currency"               VARCHAR,
  "closed_at"              TIMESTAMP_NTZ,
  "closing_at"             TIMESTAMP_NTZ,
  "stage"                  VARCHAR,
  "stage_id"               VARCHAR,
  "pipeline"               VARCHAR,
  "pipeline_id"            VARCHAR,
  "stages"                 VARIANT,
  "pipelines"              VARIANT,
  "source"                 VARCHAR,
  "probability"            FLOAT,
  "tags"                   VARIANT,
  "lost_reason"            VARCHAR,
  "won_reason"             VARCHAR,
  "user_id"                VARCHAR,
  "contact_ids"            VARIANT,
  "company_ids"            VARIANT,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Contact
-- ======================
CREATE TABLE "unified_crm_contact" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "title"                  VARCHAR,
  "company"                VARCHAR,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "deal_ids"               VARIANT,
  "company_ids"            VARIANT,
  "address"                VARIANT,
  "user_id"                VARCHAR,
  "link_urls"              VARIANT,
  "metadata"               VARIANT,
  "department"             VARCHAR,
  "image_url"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Company
-- ======================
CREATE TABLE "unified_crm_company" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "deal_ids"               VARIANT,
  "contact_ids"            VARIANT,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "websites"               VARIANT,
  "address"                VARIANT,
  "is_active"              BOOLEAN,
  "tags"                   VARIANT,
  "description"            VARCHAR,
  "industry"               VARCHAR,
  "link_urls"              VARIANT,
  "employees"              FLOAT,
  "timezone"               VARCHAR,
  "user_id"                VARCHAR,
  "metadata"               VARIANT,
  "domains"                VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Event
-- ======================
CREATE TABLE "unified_crm_event" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "type"                   VARCHAR,
  "note"                   VARIANT,
  "meeting"                VARIANT,
  "email"                  VARIANT,
  "call"                   VARIANT,
  "task"                   VARIANT,
  "marketing_email"        VARIANT,
  "form"                   VARIANT,
  "page_view"              VARIANT,
  "deal_ids"               VARIANT,
  "company_ids"            VARIANT,
  "contact_ids"            VARIANT,
  "lead_ids"               VARIANT,
  "user_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Lead
-- ======================
CREATE TABLE "unified_crm_lead" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "user_id"                VARCHAR,
  "creator_user_id"        VARCHAR,
  "contact_id"             VARCHAR,
  "company_id"             VARCHAR,
  "company_name"           VARCHAR,
  "is_active"              BOOLEAN,
  "address"                VARIANT,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "source"                 VARCHAR,
  "status"                 VARCHAR,
  "link_urls"              VARIANT,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Picklist
-- ======================
CREATE TABLE "unified_crm_picklist" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "name"                   VARCHAR,
  "label"                  VARCHAR,
  "type"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CRM: Pipeline
-- ======================
CREATE TABLE "unified_crm_pipeline" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "is_active"              BOOLEAN,
  "deal_probability"       FLOAT,
  "display_order"          FLOAT,
  "stages"                 VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- MARTECH: List
-- ======================
CREATE TABLE "unified_martech_list" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "is_active"              BOOLEAN,
  "address"                VARIANT,
  "subject"                VARCHAR,
  "sender_name"            VARCHAR,
  "sender_email"           VARCHAR,
  "language"               VARCHAR,
  "sender_company"         VARCHAR,
  "sender_phone"           VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- MARTECH: Member
-- ======================
CREATE TABLE "unified_martech_member" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "company"                VARCHAR,
  "emails"                 VARIANT,
  "list_ids"               VARIANT,
  "tags"                   VARIANT,
  "status"                 VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- MARTECH: Campaign
-- ======================
CREATE TABLE "unified_martech_campaign" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "type"                   VARCHAR,
  "status"                 VARCHAR,
  "list_ids"               VARIANT,
  "subject_line"           VARCHAR,
  "preview_text"           VARCHAR,
  "from_name"              VARCHAR,
  "from_email"             VARCHAR,
  "reply_to_email"         VARCHAR,
  "send_at"                TIMESTAMP_NTZ,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- MARTECH: Report
-- ======================
CREATE TABLE "unified_martech_report" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "campaign_id"            VARCHAR,
  "list_id"                VARCHAR,
  "emails_sent"            FLOAT,
  "abuse_reports"          FLOAT,
  "unsubscribed"           FLOAT,
  "sent_at"                TIMESTAMP_NTZ,
  "hard_bounces"           FLOAT,
  "soft_bounces"           FLOAT,
  "syntax_errors"          FLOAT,
  "forwards_count"         FLOAT,
  "forwards_opens"         FLOAT,
  "opens_total"            FLOAT,
  "unique_opens"           FLOAT,
  "open_rate"              FLOAT,
  "last_open_at"           TIMESTAMP_NTZ,
  "clicks_total"           FLOAT,
  "unique_clicks"          FLOAT,
  "unique_subscriber_clicks" FLOAT,
  "click_rate"             FLOAT,
  "last_click_at"          TIMESTAMP_NTZ,
  "links"                  VARIANT,
  "human_opens_total"      FLOAT,
  "human_unique_opens"     FLOAT,
  "human_open_rate"        FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TICKETING: Ticket
-- ======================
CREATE TABLE "unified_ticketing_ticket" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "customer_id"            VARCHAR,
  "subject"                VARCHAR,
  "description"            VARCHAR,
  "status"                 VARCHAR,
  "closed_at"              TIMESTAMP_NTZ,
  "priority"               VARCHAR,
  "category_id"            VARCHAR,
  "source"                 VARCHAR,
  "source_ref"             VARCHAR,
  "tags"                   VARIANT,
  "user_id"                VARCHAR,
  "url"                    VARCHAR,
  "due_at"                 TIMESTAMP_NTZ,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TICKETING: Customer
-- ======================
CREATE TABLE "unified_ticketing_customer" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "tags"                   VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TICKETING: Note
-- ======================
CREATE TABLE "unified_ticketing_note" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "customer_id"            VARCHAR,
  "description"            VARCHAR,
  "ticket_id"              VARCHAR,
  "user_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TICKETING: Category
-- ======================
CREATE TABLE "unified_ticketing_category" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- UC: Call
-- ======================
CREATE TABLE "unified_uc_call" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "contact_id"             VARCHAR,
  "telephone"              VARIANT,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "contacts"               VARIANT,
  "is_private"             BOOLEAN,
  "user_name"              VARCHAR,
  "user_phone"             VARCHAR,
  "type"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- UC: Contact
-- ======================
CREATE TABLE "unified_uc_contact" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "title"                  VARCHAR,
  "company"                VARCHAR,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- UC: Comment
-- ======================
CREATE TABLE "unified_uc_comment" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             VARCHAR,
  "updated_at"             VARCHAR,
  "content"                VARCHAR,
  "user_id"                VARCHAR,
  "call_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- UC: Recording
-- ======================
CREATE TABLE "unified_uc_recording" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "expires_at"             TIMESTAMP_NTZ,
  "call_id"                VARCHAR,
  "web_url"                VARCHAR,
  "contact_id"             VARCHAR,
  "contact_name"           VARCHAR,
  "contact_phone"          VARCHAR,
  "contacts"               VARIANT,
  "user_id"                VARCHAR,
  "media"                  VARIANT,
  "user_name"              VARCHAR,
  "user_phone"             VARCHAR,
  "type"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Activity
-- ======================
CREATE TABLE "unified_ats_activity" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "candidate_id"           VARCHAR,
  "application_id"         VARCHAR,
  "job_id"                 VARCHAR,
  "interview_id"           VARCHAR,
  "document_ids"           VARIANT,
  "title"                  VARCHAR,
  "description"            VARCHAR,
  "is_private"             BOOLEAN,
  "user_ids"               VARIANT,
  "type"                   VARCHAR,
  "from"                   VARIANT,
  "to"                     VARIANT,
  "cc"                     VARIANT,
  "bcc"                    VARIANT,
  "sub_type"               VARCHAR,
  "company_id"             VARCHAR,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Candidate
-- ======================
CREATE TABLE "unified_ats_candidate" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "emails"                 VARIANT,
  "title"                  VARCHAR,
  "telephones"             VARIANT,
  "company_name"           VARCHAR,
  "image_url"              VARCHAR,
  "tags"                   VARIANT,
  "address"                VARIANT,
  "external_identifier"    VARCHAR,
  "link_urls"              VARIANT,
  "origin"                 VARCHAR,
  "company_id"             VARCHAR,
  "sources"                VARIANT,
  "date_of_birth"          TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "user_ids"               VARIANT,
  "web_url"                VARCHAR,
  "experiences"            VARIANT,
  "education"              VARIANT,
  "skills"                 VARIANT,
  "job_ids"                VARIANT,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Job
-- ======================
CREATE TABLE "unified_ats_job" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "recruiter_ids"          VARIANT,
  "hiring_manager_ids"     VARIANT,
  "hiring_managers"        VARIANT,
  "status"                 VARCHAR,
  "closed_at"              TIMESTAMP_NTZ,
  "addresses"              VARIANT,
  "compensation"           VARIANT,
  "employment_type"        VARCHAR,
  "remote"                 BOOLEAN,
  "language_locale"        VARCHAR,
  "public_job_urls"        VARIANT,
  "number_of_openings"     FLOAT,
  "company_id"             VARCHAR,
  "questions"              VARIANT,
  "postings"               VARIANT,
  "groups"                 VARIANT,
  "openings"               VARIANT,
  "minimum_experience_years" FLOAT,
  "minimum_degree"         VARCHAR,
  "skills"                 VARIANT,
  "metadata"               VARIANT,
  "user_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Interview
-- ======================
CREATE TABLE "unified_ats_interview" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "candidate_id"           VARCHAR,
  "job_id"                 VARCHAR,
  "application_id"         VARCHAR,
  "user_ids"               VARIANT,
  "status"                 VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "location"               VARCHAR,
  "external_event_xref"    VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Document
-- ======================
CREATE TABLE "unified_ats_document" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "document_url"           VARCHAR,
  "document_data"          VARCHAR,
  "filename"               VARCHAR,
  "type"                   VARCHAR,
  "candidate_id"           VARCHAR,
  "application_id"         VARCHAR,
  "job_id"                 VARCHAR,
  "user_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Applicationstatus
-- ======================
CREATE TABLE "unified_ats_applicationstatu" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "job_id"                 VARCHAR,
  "status"                 VARCHAR,
  "original_status"        VARCHAR,
  "description"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Application
-- ======================
CREATE TABLE "unified_ats_application" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "candidate_id"           VARCHAR,
  "job_id"                 VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "applied_at"             TIMESTAMP_NTZ,
  "hired_at"               TIMESTAMP_NTZ,
  "rejected_at"            TIMESTAMP_NTZ,
  "rejected_reason"        VARCHAR,
  "source"                 VARCHAR,
  "status"                 VARCHAR,
  "original_status"        VARCHAR,
  "answers"                VARIANT,
  "offers"                 VARIANT,
  "user_id"                VARCHAR,
  "metadata"               VARIANT,
  "original_substatus"     VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Scorecard
-- ======================
CREATE TABLE "unified_ats_scorecard" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "application_id"         VARCHAR,
  "interviewer_id"         VARCHAR,
  "interview_id"           VARCHAR,
  "candidate_id"           VARCHAR,
  "job_id"                 VARCHAR,
  "recommendation"         VARCHAR,
  "comment"                VARCHAR,
  "questions"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ATS: Company
-- ======================
CREATE TABLE "unified_ats_company" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "address"                VARIANT,
  "website_url"            VARCHAR,
  "phone"                  VARCHAR,
  "parent_id"              VARCHAR,
  "recruiter_ids"          VARIANT,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Employee
-- ======================
CREATE TABLE "unified_hris_employee" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "emails"                 VARIANT,
  "title"                  VARCHAR,
  "manager_id"             VARCHAR,
  "employment_status"      VARCHAR,
  "gender"                 VARCHAR,
  "telephones"             VARIANT,
  "date_of_birth"          TIMESTAMP_NTZ,
  "employee_number"        VARCHAR,
  "hired_at"               TIMESTAMP_NTZ,
  "terminated_at"          TIMESTAMP_NTZ,
  "termination_reason"     VARCHAR,
  "marital_status"         VARCHAR,
  "employment_type"        VARCHAR,
  "address"                VARIANT,
  "language_locale"        VARCHAR,
  "currency"               VARCHAR,
  "timezone"               VARCHAR,
  "image_url"              VARCHAR,
  "company_id"             VARCHAR,
  "pronouns"               VARCHAR,
  "employee_roles"         VARIANT,
  "compensation"           VARIANT,
  "salutation"             VARCHAR,
  "bio"                    VARCHAR,
  "ssn_sin"                VARCHAR,
  "groups"                 VARIANT,
  "locations"              VARIANT,
  "metadata"               VARIANT,
  "storage_quota_allocated" FLOAT,
  "storage_quota_used"     FLOAT,
  "storage_quota_available" FLOAT,
  "relationships"          VARIANT,
  "has_mfa"                BOOLEAN,
  "timeoff_days_total"     FLOAT,
  "timeoff_days_used"      FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Company
-- ======================
CREATE TABLE "unified_hris_company" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "legal_name"             VARCHAR,
  "address"                VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Location
-- ======================
CREATE TABLE "unified_hris_location" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "address"                VARIANT,
  "parent_id"              VARCHAR,
  "external_identifier"    VARCHAR,
  "telephones"             VARIANT,
  "timezone"               VARCHAR,
  "currency"               VARCHAR,
  "language_locale"        VARCHAR,
  "is_active"              BOOLEAN,
  "is_hq"                  BOOLEAN,
  "company_id"             VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Group
-- ======================
CREATE TABLE "unified_hris_group" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "parent_id"              VARCHAR,
  "type"                   VARCHAR,
  "user_ids"               VARIANT,
  "manager_ids"            VARIANT,
  "is_active"              BOOLEAN,
  "company_id"             VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Timeoff
-- ======================
CREATE TABLE "unified_hris_timeoff" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "company_id"             VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "is_paid"                BOOLEAN,
  "status"                 VARCHAR,
  "approver_user_id"       VARCHAR,
  "approved_at"            TIMESTAMP_NTZ,
  "comments"               VARCHAR,
  "reason"                 VARCHAR,
  "type"                   VARCHAR,
  "duration"               FLOAT,
  "duration_type"          VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Payslip
-- ======================
CREATE TABLE "unified_hris_payslip" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "company_id"             VARCHAR,
  "payment_reference"      VARCHAR,
  "payment_type"           VARCHAR,
  "paid_at"                TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "currency"               VARCHAR,
  "gross_amount"           FLOAT,
  "net_amount"             FLOAT,
  "details"                VARIANT,
  "deduction"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Device
-- ======================
CREATE TABLE "unified_hris_device" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "asset_tag"              VARCHAR,
  "version"                VARCHAR,
  "manufacturer"           VARCHAR,
  "model"                  VARCHAR,
  "os"                     VARCHAR,
  "os_version"             VARCHAR,
  "user_ids"               VARIANT,
  "admin_user_ids"         VARIANT,
  "location_id"            VARCHAR,
  "has_antivirus"          BOOLEAN,
  "has_password_manager"   BOOLEAN,
  "has_firewall"           BOOLEAN,
  "has_hd_encrypted"       BOOLEAN,
  "has_screenlock"         BOOLEAN,
  "is_missing"             BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Timeshift
-- ======================
CREATE TABLE "unified_hris_timeshift" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "employee_user_id"       VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "location_id"            VARCHAR,
  "company_id"             VARCHAR,
  "group_id"               VARCHAR,
  "compensation"           VARIANT,
  "approver_user_id"       VARCHAR,
  "approved_at"            TIMESTAMP_NTZ,
  "hours"                  FLOAT,
  "is_approved"            BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Benefit
-- ======================
CREATE TABLE "unified_hris_benefit" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "company_id"             VARCHAR,
  "type"                   VARCHAR,
  "tax"                    VARCHAR,
  "frequency"              VARCHAR,
  "is_active"              BOOLEAN,
  "employer_contribution_type" VARCHAR,
  "employer_contribution_amount" FLOAT,
  "employer_contribution_max_amount" FLOAT,
  "coverage_level"         VARCHAR,
  "currency"               VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Deduction
-- ======================
CREATE TABLE "unified_hris_deduction" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "company_id"             VARCHAR,
  "benefit_id"             VARCHAR,
  "amount"                 FLOAT,
  "type"                   VARCHAR,
  "coverage_level"         VARCHAR,
  "frequency"              VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "is_active"              BOOLEAN,
  "notes"                  VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Bankaccount
-- ======================
CREATE TABLE "unified_hris_bankaccount" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "company_id"             VARCHAR,
  "account_type"           VARCHAR,
  "bank_name"              VARCHAR,
  "routing_number"         VARCHAR,
  "account_number"         VARCHAR,
  "account_number_last4"   VARCHAR,
  "name"                   VARCHAR,
  "is_primary"             BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Taxonomy
-- ======================
CREATE TABLE "unified_hris_taxonomy" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "type"                   VARCHAR,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "domain"                 VARCHAR,
  "category"               VARCHAR,
  "subcategory"            VARCHAR,
  "parent_id"              VARCHAR,
  "alternative_names"      VARIANT,
  "url"                    VARCHAR,
  "role_ids"               VARIANT,
  "is_active"              BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- HRIS: Document
-- ======================
CREATE TABLE "unified_hris_document" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "document_url"           VARCHAR,
  "document_data"          VARCHAR,
  "filename"               VARCHAR,
  "type"                   VARCHAR,
  "user_id"                VARCHAR,
  "company_id"             VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- VERIFICATION: Package
-- ======================
CREATE TABLE "unified_verification_package" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "type"                   VARCHAR,
  "aliases"                VARIANT,
  "tags"                   VARIANT,
  "description"            VARCHAR,
  "parameters"             VARIANT,
  "average_processing_times" VARIANT,
  "has_redirect_url"       BOOLEAN,
  "has_target_url"         BOOLEAN,
  "needs_ip_address"       BOOLEAN,
  "cost_amount"            FLOAT,
  "currency"               VARCHAR,
  "max_score"              FLOAT,
  "info_url"               VARCHAR,
  "valid_regions"          VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- VERIFICATION: Request
-- ======================
CREATE TABLE "unified_verification_request" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "package_id"             VARCHAR,
  "parameters"             VARIANT,
  "target_url"             VARCHAR,
  "candidate_id"           VARCHAR,
  "profile_ip_address"     VARCHAR,
  "profile_name"           VARCHAR,
  "profile_date_of_birth"  VARCHAR,
  "profile_addresses"      VARIANT,
  "profile_gender"         VARCHAR,
  "profile_emails"         VARIANT,
  "profile_telephones"     VARIANT,
  "profile_national_identifier" VARCHAR,
  "response_completed_at"  TIMESTAMP_NTZ,
  "response_expires_at"    TIMESTAMP_NTZ,
  "response_issued_at"     TIMESTAMP_NTZ,
  "response_status"        VARCHAR,
  "response_score"         FLOAT,
  "response_redirect_url"  VARCHAR,
  "response_download_urls" VARIANT,
  "response_details"       VARIANT,
  "response_source"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Account
-- ======================
CREATE TABLE "unified_accounting_account" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "type"                   VARCHAR,
  "status"                 VARCHAR,
  "balance"                FLOAT,
  "currency"               VARCHAR,
  "customer_defined_code"  VARCHAR,
  "is_payable"             BOOLEAN,
  "section"                VARCHAR,
  "subsection"             VARCHAR,
  "group"                  VARCHAR,
  "subgroup"               VARCHAR,
  "parent_id"              VARCHAR,
  "taxonomy"               VARIANT,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Journal
-- ======================
CREATE TABLE "unified_accounting_journal" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "reference"              VARCHAR,
  "tax_amount"             FLOAT,
  "currency"               VARCHAR,
  "lineitems"              VARIANT,
  "taxrate_id"             VARCHAR,
  "description"            VARCHAR,
  "posted_at"              TIMESTAMP_NTZ,
  "source"                 VARCHAR,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Transaction
-- ======================
CREATE TABLE "unified_accounting_transaction" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "memo"                   VARCHAR,
  "total_amount"           FLOAT,
  "tax_amount"             FLOAT,
  "account_id"             VARCHAR,
  "reference"              VARCHAR,
  "sub_total_amount"       FLOAT,
  "split_account_id"       VARCHAR,
  "payment_method"         VARCHAR,
  "payment_terms"          VARCHAR,
  "customer_message"       VARCHAR,
  "type"                   VARCHAR,
  "lineitems"              VARIANT,
  "currency"               VARCHAR,
  "contacts"               VARIANT,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Contact
-- ======================
CREATE TABLE "unified_accounting_contact" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "currency"               VARCHAR,
  "billing_address"        VARIANT,
  "shipping_address"       VARIANT,
  "is_active"              BOOLEAN,
  "tax_exemption"          VARCHAR,
  "tax_number"             VARCHAR,
  "is_customer"            BOOLEAN,
  "is_supplier"            BOOLEAN,
  "portal_url"             VARCHAR,
  "payment_methods"        VARIANT,
  "company_name"           VARCHAR,
  "identification"         VARCHAR,
  "associated_contacts"    VARIANT,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Invoice
-- ======================
CREATE TABLE "unified_accounting_invoice" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "due_at"                 TIMESTAMP_NTZ,
  "paid_at"                TIMESTAMP_NTZ,
  "refunded_at"            TIMESTAMP_NTZ,
  "cancelled_at"           TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "paid_amount"            FLOAT,
  "refund_amount"          FLOAT,
  "tax_amount"             FLOAT,
  "discount_amount"        FLOAT,
  "balance_amount"         FLOAT,
  "invoice_number"         VARCHAR,
  "reference"              VARCHAR,
  "contact_id"             VARCHAR,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "refund_reason"          VARCHAR,
  "term"                   VARCHAR,
  "lineitems"              VARIANT,
  "status"                 VARCHAR,
  "url"                    VARCHAR,
  "payment_collection_method" VARCHAR,
  "type"                   VARCHAR,
  "attachments"            VARIANT,
  "send"                   BOOLEAN,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Bill
-- ======================
CREATE TABLE "unified_accounting_bill" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "bill_number"            VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "due_at"                 TIMESTAMP_NTZ,
  "paid_at"                TIMESTAMP_NTZ,
  "refunded_at"            TIMESTAMP_NTZ,
  "cancelled_at"           TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "paid_amount"            FLOAT,
  "refund_amount"          FLOAT,
  "tax_amount"             FLOAT,
  "discount_amount"        FLOAT,
  "balance_amount"         FLOAT,
  "contact_id"             VARCHAR,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "refund_reason"          VARCHAR,
  "lineitems"              VARIANT,
  "status"                 VARCHAR,
  "url"                    VARCHAR,
  "payment_collection_method" VARCHAR,
  "attachments"            VARIANT,
  "send"                   BOOLEAN,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  "term"                   VARCHAR,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Creditmemo
-- ======================
CREATE TABLE "unified_accounting_creditmemo" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "due_at"                 TIMESTAMP_NTZ,
  "paid_at"                TIMESTAMP_NTZ,
  "refunded_at"            TIMESTAMP_NTZ,
  "cancelled_at"           TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "paid_amount"            FLOAT,
  "refund_amount"          FLOAT,
  "tax_amount"             FLOAT,
  "discount_amount"        FLOAT,
  "balance_amount"         FLOAT,
  "creditmemo_number"      VARCHAR,
  "contact_id"             VARCHAR,
  "invoice_id"             VARCHAR,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "refund_reason"          VARCHAR,
  "lineitems"              VARIANT,
  "status"                 VARCHAR,
  "url"                    VARCHAR,
  "payment_collection_method" VARCHAR,
  "attachments"            VARIANT,
  "send"                   BOOLEAN,
  "organization_id"        VARCHAR,
  "apply_amount"           FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Vendorcredit
-- ======================
CREATE TABLE "unified_accounting_vendorcredit" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "due_at"                 TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "balance_amount"         FLOAT,
  "account_id"             VARCHAR,
  "currency"               VARCHAR,
  "contact_id"             VARCHAR,
  "bill_id"                VARCHAR,
  "notes"                  VARCHAR,
  "lineitems"              VARIANT,
  "status"                 VARCHAR,
  "organization_id"        VARCHAR,
  "apply_amount"           FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Taxrate
-- ======================
CREATE TABLE "unified_accounting_taxrate" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "rate"                   FLOAT,
  "is_active"              BOOLEAN,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Organization
-- ======================
CREATE TABLE "unified_accounting_organization" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "legal_name"             VARCHAR,
  "currency"               VARCHAR,
  "address"                VARIANT,
  "tax_number"             VARCHAR,
  "timezone"               VARCHAR,
  "website"                VARCHAR,
  "parent_id"              VARCHAR,
  "fiscal_year_end_month"  FLOAT,
  "organization_code"      VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Order
-- ======================
CREATE TABLE "unified_accounting_order" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "contact_id"             VARCHAR,
  "account_id"             VARCHAR,
  "type"                   VARCHAR,
  "currency"               VARCHAR,
  "total_amount"           FLOAT,
  "shipping_address"       VARIANT,
  "billing_address"        VARIANT,
  "status"                 VARCHAR,
  "lineitems"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Purchaseorder
-- ======================
CREATE TABLE "unified_accounting_purchaseorder" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "contact_id"             VARCHAR,
  "account_id"             VARCHAR,
  "currency"               VARCHAR,
  "total_amount"           FLOAT,
  "shipping_address"       VARIANT,
  "billing_address"        VARIANT,
  "status"                 VARCHAR,
  "lineitems"              VARIANT,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Salesorder
-- ======================
CREATE TABLE "unified_accounting_salesorder" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "posted_at"              TIMESTAMP_NTZ,
  "contact_id"             VARCHAR,
  "account_id"             VARCHAR,
  "currency"               VARCHAR,
  "total_amount"           FLOAT,
  "shipping_address"       VARIANT,
  "billing_address"        VARIANT,
  "status"                 VARCHAR,
  "lineitems"              VARIANT,
  "sales_channel"          VARCHAR,
  "organization_id"        VARCHAR,
  "fees"                   VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Report
-- ======================
CREATE TABLE "unified_accounting_report" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "type"                   VARCHAR,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "balance_sheet"          VARIANT,
  "profit_and_loss"        VARIANT,
  "trial_balance"          VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Balancesheet
-- ======================
CREATE TABLE "unified_accounting_balancesheet" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "net_assets_amount"      FLOAT,
  "assets"                 VARIANT,
  "liabilities"            VARIANT,
  "equity"                 VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Trialbalance
-- ======================
CREATE TABLE "unified_accounting_trialbalance" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "end_at"                 TIMESTAMP_NTZ,
  "total_debit_amount"     FLOAT,
  "total_credit_amount"    FLOAT,
  "sub_items"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Profitloss
-- ======================
CREATE TABLE "unified_accounting_profitlos" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "category_ids"           VARIANT,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "income"                 VARIANT,
  "expenses"               VARIANT,
  "cost_of_goods_sold"     VARIANT,
  "gross_profit_amount"    FLOAT,
  "net_profit_amount"      FLOAT,
  "income_total_amount"    FLOAT,
  "net_income_amount"      FLOAT,
  "expenses_total_amount"  FLOAT,
  "cost_of_goods_sold_total_amount" FLOAT,
  "income_sections"        VARIANT,
  "expenses_sections"      VARIANT,
  "cost_of_goods_sold_sections" VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Cashflow
-- ======================
CREATE TABLE "unified_accounting_cashflow" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "category_ids"           VARIANT,
  "contact_id"             VARCHAR,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "cash_beginning_amount"  FLOAT,
  "cash_ending_amount"     FLOAT,
  "net_change_in_cash_amount" FLOAT,
  "operating_sections"     VARIANT,
  "investing_sections"     VARIANT,
  "financing_sections"     VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Category
-- ======================
CREATE TABLE "unified_accounting_category" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ACCOUNTING: Expense
-- ======================
CREATE TABLE "unified_accounting_expense" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "contact_id"             VARCHAR,
  "account_id"             VARCHAR,
  "name"                   VARCHAR,
  "payment_method"         VARCHAR,
  "posted_at"              TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "currency"               VARCHAR,
  "tax_amount"             FLOAT,
  "reimbursed_amount"      FLOAT,
  "reimbursed_at"          TIMESTAMP_NTZ,
  "approved_at"            TIMESTAMP_NTZ,
  "approver_user_id"       VARCHAR,
  "lineitems"              VARIANT,
  "attachments"            VARIANT,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- STORAGE: File
-- ======================
CREATE TABLE "unified_storage_file" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "parent_id"              VARCHAR,
  "user_id"                VARCHAR,
  "size"                   FLOAT,
  "type"                   VARCHAR,
  "mime_type"              VARCHAR,
  "permissions"            VARIANT,
  "download_url"           VARCHAR,
  "hash"                   VARCHAR,
  "data"                   VARCHAR,
  "version"                VARCHAR,
  "web_url"                VARCHAR,
  "references"             VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Item
-- ======================
CREATE TABLE "unified_commerce_item" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "public_name"            VARCHAR,
  "slug"                   VARCHAR,
  "description"            VARCHAR,
  "global_code"            VARCHAR,
  "public_description"     VARCHAR,
  "is_active"              BOOLEAN,
  "is_taxable"             BOOLEAN,
  "vendor_name"            VARCHAR,
  "type"                   VARCHAR,
  "is_visible"             BOOLEAN,
  "is_featured"            BOOLEAN,
  "weight"                 FLOAT,
  "weight_unit"            VARCHAR,
  "requires_shipping"      BOOLEAN,
  "prices"                 VARIANT,
  "inventory_id"           VARCHAR,
  "total_stock"            FLOAT,
  "variants"               VARIANT,
  "tags"                   VARIANT,
  "media"                  VARIANT,
  "collection_ids"         VARIANT,
  "account_id"             VARCHAR,
  "metadata"               VARIANT,
  "collections"            VARIANT,
  "taxrate_id"             VARCHAR,
  "location_id"            VARCHAR,
  "duration"               FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Collection
-- ======================
CREATE TABLE "unified_commerce_collection" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "public_name"            VARCHAR,
  "description"            VARCHAR,
  "public_description"     VARCHAR,
  "media"                  VARIANT,
  "is_visible"             BOOLEAN,
  "is_active"              BOOLEAN,
  "is_featured"            BOOLEAN,
  "tags"                   VARIANT,
  "type"                   VARCHAR,
  "parent_id"              VARCHAR,
  "metadata"               VARIANT,
  "item_metadata"          VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Inventory
-- ======================
CREATE TABLE "unified_commerce_inventory" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "updated_at"             TIMESTAMP_NTZ,
  "item_id"                VARCHAR,
  "item_variant_id"        VARCHAR,
  "item_option_id"         VARCHAR,
  "location_id"            VARCHAR,
  "available"              FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Location
-- ======================
CREATE TABLE "unified_commerce_location" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "address"                VARIANT,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "language_locale"        VARCHAR,
  "parent_id"              VARCHAR,
  "currency"               VARCHAR,
  "location_type"          VARCHAR,
  "telephones"             VARIANT,
  "rating"                 FLOAT,
  "review_count"           FLOAT,
  "price_level"            VARCHAR,
  "latitude"               FLOAT,
  "longitude"              FLOAT,
  "image_url"              VARCHAR,
  "web_url"                VARCHAR,
  "media"                  VARIANT,
  "raw"                    VARIANT,
  "categories"             VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Review
-- ======================
CREATE TABLE "unified_commerce_review" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "item_id"                VARCHAR,
  "item_variant_id"        VARCHAR,
  "location_id"            VARCHAR,
  "rating"                 FLOAT,
  "title"                  VARCHAR,
  "content"                VARCHAR,
  "author_name"            VARCHAR,
  "author_email"           VARCHAR,
  "author_avatar_url"      VARCHAR,
  "author_location"        VARCHAR,
  "verified_purchase"      BOOLEAN,
  "helpful_votes"          FLOAT,
  "unhelpful_votes"        FLOAT,
  "media"                  VARIANT,
  "status"                 VARCHAR,
  "is_verified"            BOOLEAN,
  "is_featured"            BOOLEAN,
  "is_public"              BOOLEAN,
  "comments"               VARIANT,
  "metadata"               VARIANT,
  "url"                    VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Reservation
-- ======================
CREATE TABLE "unified_commerce_reservation" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "location_id"            VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "size"                   FLOAT,
  "status"                 VARCHAR,
  "guest_name"             VARCHAR,
  "guest_phone"            VARCHAR,
  "guest_email"            VARCHAR,
  "notes"                  VARCHAR,
  "item_id"                VARCHAR,
  "item_name"              VARCHAR,
  "staff_user_id"          VARCHAR,
  "staff_name"             VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "url"                    VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Availability
-- ======================
CREATE TABLE "unified_commerce_availability" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "location_id"            VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "size"                   FLOAT,
  "item_id"                VARCHAR,
  "staff_user_id"          VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Saleschannel
-- ======================
CREATE TABLE "unified_commerce_saleschannel" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "slug"                   VARCHAR,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "collections"            VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- COMMERCE: Itemvariant
-- ======================
CREATE TABLE "unified_commerce_itemvariant" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "public_name"            VARCHAR,
  "description"            VARCHAR,
  "public_description"     VARCHAR,
  "sku"                    VARCHAR,
  "is_active"              BOOLEAN,
  "is_visible"             BOOLEAN,
  "is_featured"            BOOLEAN,
  "media"                  VARIANT,
  "available_at"           TIMESTAMP_NTZ,
  "tags"                   VARIANT,
  "width"                  FLOAT,
  "height"                 FLOAT,
  "length"                 FLOAT,
  "weight"                 FLOAT,
  "size_unit"              VARCHAR,
  "weight_unit"            VARCHAR,
  "total_stock"            FLOAT,
  "prices"                 VARIANT,
  "options"                VARIANT,
  "inventory_id"           VARCHAR,
  "requires_shipping"      BOOLEAN,
  "metadata"               VARIANT,
  "items"                  VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- PAYMENT: Payment
-- ======================
CREATE TABLE "unified_payment_payment" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "contact_id"             VARCHAR,
  "payment_method"         VARCHAR,
  "type"                   VARCHAR,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "invoice_id"             VARCHAR,
  "bill_id"                VARCHAR,
  "link_id"                VARCHAR,
  "account_id"             VARCHAR,
  "reference"              VARCHAR,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- PAYMENT: Link
-- ======================
CREATE TABLE "unified_payment_link" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "is_active"              BOOLEAN,
  "lineitems"              VARIANT,
  "currency"               VARCHAR,
  "amount"                 FLOAT,
  "payment_id"             VARCHAR,
  "contact_id"             VARCHAR,
  "url"                    VARCHAR,
  "is_chargeable_now"      BOOLEAN,
  "success_url"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- PAYMENT: Refund
-- ======================
CREATE TABLE "unified_payment_refund" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "total_amount"           FLOAT,
  "payment_id"             VARCHAR,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "status"                 VARCHAR,
  "reference"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- PAYMENT: Payout
-- ======================
CREATE TABLE "unified_payment_payout" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             VARCHAR,
  "updated_at"             VARCHAR,
  "total_amount"           FLOAT,
  "currency"               VARCHAR,
  "notes"                  VARCHAR,
  "status"                 VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- PAYMENT: Subscription
-- ======================
CREATE TABLE "unified_payment_subscription" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "description"            VARCHAR,
  "contact_id"             VARCHAR,
  "invoice_id"             VARCHAR,
  "current_period_end_at"  TIMESTAMP_NTZ,
  "current_period_start_at" TIMESTAMP_NTZ,
  "canceled_at"            TIMESTAMP_NTZ,
  "currency"               VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "status"                 VARCHAR,
  "month"                  FLOAT,
  "interval_unit"          VARCHAR,
  "day_of_month"           FLOAT,
  "day_of_week"            FLOAT,
  "interval"               FLOAT,
  "lineitems"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- GENAI: Model
-- ======================
CREATE TABLE "unified_genai_model" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "max_tokens"             FLOAT,
  "web_url"                VARCHAR,
  "has_temperature"        BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- KMS: Space
-- ======================
CREATE TABLE "unified_kms_space" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "parent_id"              VARCHAR,
  "is_active"              BOOLEAN,
  "user_id"                VARCHAR,
  "parent_page_id"         VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- KMS: Page
-- ======================
CREATE TABLE "unified_kms_page" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "title"                  VARCHAR,
  "type"                   VARCHAR,
  "space_id"               VARCHAR,
  "parent_id"              VARCHAR,
  "is_active"              BOOLEAN,
  "user_id"                VARCHAR,
  "download_url"           VARCHAR,
  "metadata"               VARIANT,
  "has_children"           BOOLEAN,
  "web_url"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- KMS: Comment
-- ======================
CREATE TABLE "unified_kms_comment" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "type"                   VARCHAR,
  "content_type"           VARCHAR,
  "content"                VARCHAR,
  "user_id"                VARCHAR,
  "page_id"                VARCHAR,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TASK: Project
-- ======================
CREATE TABLE "unified_task_project" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "parent_id"              VARCHAR,
  "user_ids"               VARIANT,
  "group_ids"              VARIANT,
  "description"            VARCHAR,
  "has_tasks"              BOOLEAN,
  "has_children"           BOOLEAN,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TASK: Task
-- ======================
CREATE TABLE "unified_task_task" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "project_id"             VARCHAR,
  "parent_id"              VARCHAR,
  "completed_at"           TIMESTAMP_NTZ,
  "status"                 VARCHAR,
  "notes"                  VARCHAR,
  "due_at"                 TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "priority"               VARCHAR,
  "assigned_user_ids"      VARIANT,
  "creator_user_id"        VARCHAR,
  "follower_user_ids"      VARIANT,
  "group_ids"              VARIANT,
  "tags"                   VARIANT,
  "url"                    VARCHAR,
  "attachment_ids"         VARIANT,
  "metadata"               VARIANT,
  "has_children"           BOOLEAN,
  "type"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TASK: Comment
-- ======================
CREATE TABLE "unified_task_comment" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "text"                   VARCHAR,
  "user_id"                VARCHAR,
  "user_name"              VARCHAR,
  "task_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- TASK: Change
-- ======================
CREATE TABLE "unified_task_change" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "task_id"                VARCHAR,
  "user_id"                VARCHAR,
  "items"                  VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Calendar
-- ======================
CREATE TABLE "unified_calendar_calendar" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "timezone"               VARCHAR,
  "is_primary"             BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Event
-- ======================
CREATE TABLE "unified_calendar_event" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             VARCHAR,
  "updated_at"             VARCHAR,
  "calendar_id"            VARCHAR,
  "subject"                VARCHAR,
  "start_at"               VARCHAR,
  "end_at"                 VARCHAR,
  "is_all_day"             BOOLEAN,
  "timezone"               VARCHAR,
  "notes"                  VARCHAR,
  "location"               VARCHAR,
  "is_free"                BOOLEAN,
  "is_private"             BOOLEAN,
  "status"                 VARCHAR,
  "organizer"              VARIANT,
  "attendees"              VARIANT,
  "recurring_event_id"     VARCHAR,
  "recurrence"             VARIANT,
  "web_url"                VARCHAR,
  "has_conference"         BOOLEAN,
  "conference"             VARIANT,
  "attachments"            VARIANT,
  "send_notifications"     BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Busy
-- ======================
CREATE TABLE "unified_calendar_busy" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "timezone"               VARCHAR,
  "description"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Link
-- ======================
CREATE TABLE "unified_calendar_link" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             VARCHAR,
  "updated_at"             VARCHAR,
  "name"                   VARCHAR,
  "url"                    VARCHAR,
  "duration"               FLOAT,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "price_amount"           FLOAT,
  "price_currency"         VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Recording
-- ======================
CREATE TABLE "unified_calendar_recording" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "expires_at"             TIMESTAMP_NTZ,
  "event_id"               VARCHAR,
  "web_url"                VARCHAR,
  "media"                  VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CALENDAR: Webinar
-- ======================
CREATE TABLE "unified_calendar_webinar" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "calendar_id"            VARCHAR,
  "subject"                VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "timezone"               VARCHAR,
  "notes"                  VARCHAR,
  "status"                 VARCHAR,
  "organizer"              VARIANT,
  "join_url"               VARCHAR,
  "web_url"                VARCHAR,
  "panelists"              VARIANT,
  "registrants"            VARIANT,
  "panelist_password"      VARCHAR,
  "registrant_password"    VARCHAR,
  "conference"             VARIANT,
  "recurrence"             VARIANT,
  "capacity"               FLOAT,
  "is_webcast"             BOOLEAN,
  "is_enabled"             BOOLEAN,
  "is_auto_approve"        BOOLEAN,
  "require_first_name"     BOOLEAN,
  "require_last_name"      BOOLEAN,
  "require_email"          BOOLEAN,
  "require_company"        BOOLEAN,
  "require_job_title"      BOOLEAN,
  "require_address"        BOOLEAN,
  "require_phone"          BOOLEAN,
  "has_qa"                 BOOLEAN,
  "has_polls"              BOOLEAN,
  "has_recording"          BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Organization
-- ======================
CREATE TABLE "unified_ads_organization" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "currency"               VARCHAR,
  "timezone"               VARCHAR,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Campaign
-- ======================
CREATE TABLE "unified_ads_campaign" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "organization_id"        VARCHAR,
  "status"                 VARCHAR,
  "effective_status"       VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "budget_amount"          FLOAT,
  "budget_period"          VARCHAR,
  "total_spend_amount"     FLOAT,
  "targeting"              VARIANT,
  "goal"                   VARCHAR,
  "planned_spend_amount"   FLOAT,
  "frequency_cap"          VARIANT,
  "advertising_channel_type" VARCHAR,
  "campaign_budget_identifier" VARCHAR,
  "currency"               VARCHAR,
  "category"               VARCHAR,
  "has_eu_political_ads"   BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Creative
-- ======================
CREATE TABLE "unified_ads_creative" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "campaign_id"            VARCHAR,
  "group_id"               VARCHAR,
  "item_id"                VARCHAR,
  "organization_id"        VARCHAR,
  "status"                 VARCHAR,
  "creative_type"          VARCHAR,
  "hosting_source"         VARCHAR,
  "width"                  FLOAT,
  "height"                 FLOAT,
  "asset_urls"             VARIANT,
  "link_url"               VARCHAR,
  "body"                   VARCHAR,
  "title"                  VARCHAR,
  "cta"                    VARCHAR,
  "third_party_tag"        VARCHAR,
  "vast_tag_url"           VARCHAR,
  "external_creative_reference" VARCHAR,
  "external_placement_reference" VARCHAR,
  "external_ad_reference"  VARCHAR,
  "promoted"               VARIANT,
  "path1"                  VARCHAR,
  "path2"                  VARCHAR,
  "data"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Insertionorder
-- ======================
CREATE TABLE "unified_ads_insertionorder" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "organization_id"        VARCHAR,
  "campaign_id"            VARCHAR,
  "status"                 VARCHAR,
  "pacing"                 VARIANT,
  "frequency_cap"          VARIANT,
  "kpi"                    VARIANT,
  "budget_unit"            VARCHAR,
  "budget_segments"        VARIANT,
  "bid_strategy"           VARIANT,
  "reference"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Group
-- ======================
CREATE TABLE "unified_ads_group" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "parent_id"              VARCHAR,
  "campaign_id"            VARCHAR,
  "organization_id"        VARCHAR,
  "insertionorder_id"      VARCHAR,
  "status"                 VARCHAR,
  "effective_status"       VARCHAR,
  "targeting"              VARIANT,
  "bid_amount"             FLOAT,
  "bid_strategy"           VARIANT,
  "budget_amount"          FLOAT,
  "budget_period"          VARCHAR,
  "budget_allocation_type" VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "budget_unit"            VARCHAR,
  "budget_max_amount"      FLOAT,
  "type"                   VARCHAR,
  "has_eu_political_ads"   BOOLEAN,
  "pacing"                 VARIANT,
  "frequency_cap"          VARIANT,
  "creative_ids"           VARIANT,
  "optimization_goal"      VARCHAR,
  "billing_event"          VARCHAR,
  "currency"               VARCHAR,
  "promoted"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Ad
-- ======================
CREATE TABLE "unified_ads_ad" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "campaign_id"            VARCHAR,
  "group_id"               VARCHAR,
  "organization_id"        VARCHAR,
  "status"                 VARCHAR,
  "ad_type"                VARCHAR,
  "advertiser_name"        VARCHAR,
  "creative_ids"           VARIANT,
  "creative_asset_url"     VARCHAR,
  "ad_copy"                VARCHAR,
  "headline"               VARCHAR,
  "description"            VARCHAR,
  "cta"                    VARCHAR,
  "final_url"              VARCHAR,
  "display_url"            VARCHAR,
  "path1"                  VARCHAR,
  "path2"                  VARCHAR,
  "promoted"               VARIANT,
  "logo_creative_id"       VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Report
-- ======================
CREATE TABLE "unified_ads_report" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "currency"               VARCHAR,
  "metrics"                VARIANT,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "organization_id"        VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Target
-- ======================
CREATE TABLE "unified_ads_target" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "name"                   VARCHAR,
  "type"                   VARCHAR,
  "is_active"              BOOLEAN,
  "parent_id"              VARCHAR,
  "audience_count_min"     FLOAT,
  "audience_count_max"     FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ADS: Promoted
-- ======================
CREATE TABLE "unified_ads_promoted" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "name"                   VARCHAR,
  "type"                   VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Course
-- ======================
CREATE TABLE "unified_lms_course" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "is_private"             BOOLEAN,
  "is_active"              BOOLEAN,
  "price_amount"           FLOAT,
  "languages"              VARIANT,
  "categories"             VARIANT,
  "currency"               VARCHAR,
  "media"                  VARIANT,
  "instructor_ids"         VARIANT,
  "instructors"            VARIANT,
  "student_ids"            VARIANT,
  "students"               VARIANT,
  "content_ids"            VARIANT,
  "skills"                 VARIANT,
  "duration_minutes"       FLOAT,
  "provider_name"          VARCHAR,
  "raw"                    VARIANT,
  "published_at"           TIMESTAMP_NTZ,
  "time_estimate_minutes"  FLOAT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Class
-- ======================
CREATE TABLE "unified_lms_clas" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "media"                  VARIANT,
  "course_id"              VARCHAR,
  "instructor_ids"         VARIANT,
  "student_ids"            VARIANT,
  "languages"              VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Student
-- ======================
CREATE TABLE "unified_lms_student" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "emails"                 VARIANT,
  "telephones"             VARIANT,
  "address"                VARIANT,
  "image_url"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Instructor
-- ======================
CREATE TABLE "unified_lms_instructor" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "emails"                 VARIANT,
  "title"                  VARCHAR,
  "telephones"             VARIANT,
  "image_url"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Content
-- ======================
CREATE TABLE "unified_lms_content" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "external_reference"     VARCHAR,
  "course_ids"             VARIANT,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "languages"              VARIANT,
  "media"                  VARIANT,
  "is_active"              BOOLEAN,
  "duration_minutes"       FLOAT,
  "categories"             VARIANT,
  "skills"                 VARIANT,
  "sort_order"             FLOAT,
  "provider_name"          VARCHAR,
  "short_description"      VARCHAR,
  "localizations"          VARIANT,
  "instructor_ids"         VARIANT,
  "collection_ids"         VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Collection
-- ======================
CREATE TABLE "unified_lms_collection" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "media"                  VARIANT,
  "is_active"              BOOLEAN,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- LMS: Activity
-- ======================
CREATE TABLE "unified_lms_activity" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "content_id"             VARCHAR,
  "course_id"              VARCHAR,
  "student_id"             VARCHAR,
  "duration_minutes"       FLOAT,
  "assigned_grade"         VARCHAR,
  "is_completed"           BOOLEAN,
  "progress_percentage"    FLOAT,
  "started_at"             TIMESTAMP_NTZ,
  "completed_at"           TIMESTAMP_NTZ,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- REPO: Organization
-- ======================
CREATE TABLE "unified_repo_organization" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "avatar_url"             VARCHAR,
  "web_url"                VARCHAR,
  "user_ids"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- REPO: Repository
-- ======================
CREATE TABLE "unified_repo_repository" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "owner"                  VARCHAR,
  "is_private"             BOOLEAN,
  "web_url"                VARCHAR,
  "org_id"                 VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- REPO: Branch
-- ======================
CREATE TABLE "unified_repo_branch" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "repo_id"                VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- REPO: Commit
-- ======================
CREATE TABLE "unified_repo_commit" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_id"                VARCHAR,
  "repo_id"                VARCHAR,
  "message"                VARCHAR,
  "branch_id"              VARCHAR,
  "pullrequest_ids"        VARIANT,
  "lines_added"            FLOAT,
  "lines_deleted"          FLOAT,
  "lines_changed"          FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- REPO: Pullrequest
-- ======================
CREATE TABLE "unified_repo_pullrequest" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "user_ids"               VARIANT,
  "repo_id"                VARCHAR,
  "title"                  VARCHAR,
  "notes"                  VARCHAR,
  "target_branch_id"       VARCHAR,
  "source_branch_id"       VARCHAR,
  "status"                 VARCHAR,
  "labels"                 VARIANT,
  "closed_at"              TIMESTAMP_NTZ,
  "commit_ids"             VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- METADATA: Metadata
-- ======================
CREATE TABLE "unified_metadata_metadata" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "slug"                   VARCHAR,
  "format"                 VARCHAR,
  "original_format"        VARCHAR,
  "options"                VARIANT,
  "object_type"            VARCHAR,
  "objects"                VARIANT,
  "is_required"            BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- FORMS: Form
-- ======================
CREATE TABLE "unified_forms_form" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "fields"                 VARIANT,
  "is_active"              BOOLEAN,
  "published_url"          VARCHAR,
  "response_count"         FLOAT,
  "has_multiple_submissions" BOOLEAN,
  "has_progress_bar"       BOOLEAN,
  "has_shuffle_questions"  BOOLEAN,
  "confirmation_message"   VARCHAR,
  "confirmation_redirect_url" VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- FORMS: Submission
-- ======================
CREATE TABLE "unified_forms_submission" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "form_id"                VARCHAR,
  "respondent_email"       VARCHAR,
  "respondent_name"        VARCHAR,
  "answers"                VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- DATASTORE: Database
-- ======================
CREATE TABLE "unified_datastore_database" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "web_url"                VARCHAR,
  "is_active"              BOOLEAN,
  "password"               VARCHAR,
  "region"                 VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- DATASTORE: Table
-- ======================
CREATE TABLE "unified_datastore_table" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "database_id"            VARCHAR,
  "fields"                 VARIANT,
  "relationships"          VARIANT,
  "web_url"                VARCHAR,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- DATASTORE: Record
-- ======================
CREATE TABLE "unified_datastore_record" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "database_id"            VARCHAR,
  "table_id"               VARCHAR,
  "fields"                 VARIANT,
  "row_number"             FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SHIPPING: Shipment
-- ======================
CREATE TABLE "unified_shipping_shipment" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "order_id"               VARCHAR,
  "from_address"           VARIANT,
  "to_address"             VARIANT,
  "packages"               VARIANT,
  "carrier_id"             VARCHAR,
  "service_code"           VARCHAR,
  "status"                 VARCHAR,
  "rate_id"                VARCHAR,
  "label_id"               VARCHAR,
  "tracking_id"            VARCHAR,
  "shipped_at"             TIMESTAMP_NTZ,
  "rate_amount"            FLOAT,
  "rate_currency"          VARCHAR,
  "rate_service_name"      VARCHAR,
  "rate_estimated_days"    FLOAT,
  "rate_estimated_delivery_at" TIMESTAMP_NTZ,
  "is_rate_guaranteed"     BOOLEAN,
  "return_address"         VARIANT,
  "return_authorization_number" VARCHAR,
  "warehouse_location_id"  VARCHAR,
  "warehouse_location_name" VARCHAR,
  "customs"                VARIANT,
  "is_international"       BOOLEAN,
  "insurance"              VARIANT,
  "special_instructions"   VARIANT,
  "is_signature_required"  BOOLEAN,
  "is_adult_signature_required" BOOLEAN,
  "reference_number"       VARCHAR,
  "is_return"              BOOLEAN,
  "original_shipment_id"   VARCHAR,
  "return_reason"          VARCHAR,
  "return_type"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SHIPPING: Label
-- ======================
CREATE TABLE "unified_shipping_label" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "shipment_id"            VARCHAR,
  "tracking_number"        VARCHAR,
  "label_url"              VARCHAR,
  "label_format"           VARCHAR,
  "status"                 VARCHAR,
  "is_voided"              BOOLEAN,
  "label_cost"             FLOAT,
  "label_cost_currency"    VARCHAR,
  "rate_id"                VARCHAR,
  "service_code"           VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SHIPPING: Tracking
-- ======================
CREATE TABLE "unified_shipping_tracking" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "shipment_id"            VARCHAR,
  "tracking_number"        VARCHAR,
  "status"                 VARCHAR,
  "events"                 VARIANT,
  "estimated_delivery"     TIMESTAMP_NTZ,
  "actual_delivery_at"     TIMESTAMP_NTZ,
  "status_description"     VARCHAR,
  "carrier_id"             VARCHAR,
  "carrier_status_code"    VARCHAR,
  "carrier_status_description" VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SHIPPING: Carrier
-- ======================
CREATE TABLE "unified_shipping_carrier" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "code"                   VARCHAR,
  "is_active"              BOOLEAN,
  "logo_url"               VARCHAR,
  "website_url"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SIGNING: Document
-- ======================
CREATE TABLE "unified_signing_document" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "status"                 VARCHAR,
  "sent_at"                TIMESTAMP_NTZ,
  "completed_at"           TIMESTAMP_NTZ,
  "expires_at"             TIMESTAMP_NTZ,
  "template_id"            VARCHAR,
  "download_url"           VARCHAR,
  "creator_id"             VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SIGNING: Signatory
-- ======================
CREATE TABLE "unified_signing_signatory" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "document_id"            VARCHAR,
  "name"                   VARCHAR,
  "email"                  VARCHAR,
  "role"                   VARCHAR,
  "status"                 VARCHAR,
  "order"                  FLOAT,
  "signed_at"              TIMESTAMP_NTZ,
  "decline_reason"         VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SIGNING: Template
-- ======================
CREATE TABLE "unified_signing_template" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "is_active"              BOOLEAN,
  "creator_id"             VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CLUBS: Group
-- ======================
CREATE TABLE "unified_clubs_group" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "sport_type"             VARCHAR,
  "group_type"             VARCHAR,
  "address"                VARIANT,
  "member_count"           FLOAT,
  "following_count"        FLOAT,
  "post_count"             FLOAT,
  "is_private"             BOOLEAN,
  "is_verified"            BOOLEAN,
  "is_featured"            BOOLEAN,
  "is_admin"               BOOLEAN,
  "is_owner"               BOOLEAN,
  "membership_status"      VARCHAR,
  "url"                    VARCHAR,
  "profile_image_url"      VARCHAR,
  "cover_image_url"        VARCHAR,
  "activity_types"         VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CLUBS: Member
-- ======================
CREATE TABLE "unified_clubs_member" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "first_name"             VARCHAR,
  "last_name"              VARCHAR,
  "group_id"               VARCHAR,
  "is_admin"               BOOLEAN,
  "is_owner"               BOOLEAN,
  "membership_status"      VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CLUBS: Activity
-- ======================
CREATE TABLE "unified_clubs_activity" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "group_id"               VARCHAR,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "type"                   VARCHAR,
  "athlete_id"             VARCHAR,
  "athlete_name"           VARCHAR,
  "distance"               FLOAT,
  "moving_time"            FLOAT,
  "elapsed_time"           FLOAT,
  "total_elevation_gain"   FLOAT,
  "elevation_high"         FLOAT,
  "elevation_low"          FLOAT,
  "start_at"               TIMESTAMP_NTZ,
  "timezone"               VARCHAR,
  "achievement_count"      FLOAT,
  "kudos_count"            FLOAT,
  "comment_count"          FLOAT,
  "athlete_count"          FLOAT,
  "photo_count"            FLOAT,
  "average_speed"          FLOAT,
  "max_speed"              FLOAT,
  "average_cadence"        FLOAT,
  "average_heartrate"      FLOAT,
  "max_heartrate"          FLOAT,
  "average_watts"          FLOAT,
  "max_watts"              FLOAT,
  "weighted_average_watts" FLOAT,
  "kilojoules"             FLOAT,
  "calories"               FLOAT,
  "has_heartrate"          BOOLEAN,
  "is_trainer"             BOOLEAN,
  "is_commute"             BOOLEAN,
  "is_manual"              BOOLEAN,
  "is_private"             BOOLEAN,
  "map_polyline"           VARCHAR,
  "map_summary_polyline"   VARCHAR,
  "workout_type"           FLOAT,
  "suffer_score"           FLOAT,
  "pr_count"               FLOAT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CLUBS: Event
-- ======================
CREATE TABLE "unified_clubs_event" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "group_id"               VARCHAR,
  "name"                   VARCHAR,
  "description"            VARCHAR,
  "type"                   VARCHAR,
  "status"                 VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "timezone"               VARCHAR,
  "duration_minutes"       FLOAT,
  "location_id"            VARCHAR,
  "location_name"          VARCHAR,
  "opponent_id"            VARCHAR,
  "opponent_name"          VARCHAR,
  "home_team_name"         VARCHAR,
  "away_team_name"         VARCHAR,
  "home_score"             FLOAT,
  "away_score"             FLOAT,
  "score_for"              FLOAT,
  "score_against"          FLOAT,
  "is_home"                BOOLEAN,
  "url"                    VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- CLUBS: Location
-- ======================
CREATE TABLE "unified_clubs_location" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "group_id"               VARCHAR,
  "name"                   VARCHAR,
  "address"                VARIANT,
  "latitude"               FLOAT,
  "longitude"              FLOAT,
  "telephone"              VARCHAR,
  "url"                    VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ANALYTICS: Property
-- ======================
CREATE TABLE "unified_analytics_property" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "timezone"               VARCHAR,
  "currency"               VARCHAR,
  "industry"               VARCHAR,
  "parent_id"              VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ANALYTICS: Event
-- ======================
CREATE TABLE "unified_analytics_event" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "name"                   VARCHAR,
  "event_type"             VARCHAR,
  "visitor_id"             VARCHAR,
  "property_id"            VARCHAR,
  "session_id"             VARCHAR,
  "page_url"               VARCHAR,
  "page_title"             VARCHAR,
  "page_referrer"          VARCHAR,
  "device"                 VARCHAR,
  "browser"                VARCHAR,
  "os"                     VARCHAR,
  "country"                VARCHAR,
  "country_code"           VARCHAR,
  "region"                 VARCHAR,
  "city"                   VARCHAR,
  "metadata"               VARIANT,
  "value"                  FLOAT,
  "currency"               VARCHAR,
  "utm_source"             VARCHAR,
  "utm_medium"             VARCHAR,
  "utm_campaign"           VARCHAR,
  "utm_term"               VARCHAR,
  "utm_content"            VARCHAR,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ANALYTICS: Session
-- ======================
CREATE TABLE "unified_analytics_session" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "property_id"            VARCHAR,
  "visitor_id"             VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "duration_seconds"       FLOAT,
  "landing_page"           VARCHAR,
  "exit_page"              VARCHAR,
  "page_views"             FLOAT,
  "events_count"           FLOAT,
  "source"                 VARCHAR,
  "medium"                 VARCHAR,
  "campaign"               VARCHAR,
  "device"                 VARCHAR,
  "browser"                VARCHAR,
  "os"                     VARCHAR,
  "country"                VARCHAR,
  "city"                   VARCHAR,
  "is_bounce"              BOOLEAN,
  "is_conversion"          BOOLEAN,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ANALYTICS: Visitor
-- ======================
CREATE TABLE "unified_analytics_visitor" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "property_id"            VARCHAR,
  "email"                  VARCHAR,
  "name"                   VARCHAR,
  "age"                    FLOAT,
  "gender"                 VARCHAR,
  "country"                VARCHAR,
  "country_code"           VARCHAR,
  "city"                   VARCHAR,
  "language"               VARCHAR,
  "timezone"               VARCHAR,
  "first_seen_at"          TIMESTAMP_NTZ,
  "last_seen_at"           TIMESTAMP_NTZ,
  "total_sessions"         FLOAT,
  "total_page_views"       FLOAT,
  "total_events"           FLOAT,
  "metadata"               VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- ANALYTICS: Report
-- ======================
CREATE TABLE "unified_analytics_report" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "created_at"             TIMESTAMP_NTZ,
  "updated_at"             TIMESTAMP_NTZ,
  "property_id"            VARCHAR,
  "start_at"               TIMESTAMP_NTZ,
  "end_at"                 TIMESTAMP_NTZ,
  "metrics"                VARIANT,
  "raw"                    VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SCIM: Users
-- ======================
CREATE TABLE "unified_scim_user" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "schemas"                VARIANT,
  "externalId"             VARCHAR,
  "userType"               VARCHAR,
  "userName"               VARCHAR,
  "meta"                   VARIANT,
  "name"                   VARIANT,
  "displayName"            VARCHAR,
  "nickName"               VARCHAR,
  "profileUrl"             VARCHAR,
  "title"                  VARCHAR,
  "preferredLanguage"      VARCHAR,
  "locale"                 VARCHAR,
  "timezone"               VARCHAR,
  "active"                 BOOLEAN,
  "password"               VARCHAR,
  "phoneNumbers"           VARIANT,
  "emails"                 VARIANT,
  "ims"                    VARIANT,
  "photos"                 VARIANT,
  "addresses"              VARIANT,
  "groups"                 VARIANT,
  "entitlements"           VARIANT,
  "roles"                  VARIANT,
  "x509Certificates"       VARIANT,
  "urn:ietf:params:scim:schemas:extension:enterprise:2.0:User" VARIANT,
  "urn:ietf:params:scim:schemas:extension:lattice:attributes:1.0:User" VARIANT,
  "urn:ietf:params:scim:schemas:extension:peakon:2.0:User" VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
-- ======================
-- SCIM: Groups
-- ======================
CREATE TABLE "unified_scim_group" (
  "unified_connection_id"  VARCHAR NOT NULL,
  "unified_webhook_id"     VARCHAR NOT NULL,
  "unified_external_xref"  VARCHAR,
  "unified_integration_type" VARCHAR NOT NULL,
  "unified_raw_id"         VARCHAR,
  "unified_id"             VARCHAR NOT NULL,
  "id"                     VARCHAR,
  "externalId"             VARCHAR,
  "displayName"            VARCHAR,
  "groupType"              VARCHAR,
  "members"                VARIANT,
  "meta"                   VARIANT,
  "schemas"                VARIANT,
  UNIQUE ("unified_connection_id", "unified_id")
);
