-- ======================
-- 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")
);
