-- ======================
-- DATASTORE: Database
-- ======================
CREATE TABLE unified_datastore_database (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  name                 text,
  description          text,
  web_url              text,
  is_active            boolean,
  password             text,
  region               text,
  raw                  jsonb
);
-- ======================
-- DATASTORE: Table
-- ======================
CREATE TABLE unified_datastore_table (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  name                 text,
  description          text,
  database_id          text,
  fields               jsonb,
  relationships        jsonb,
  web_url              text,
  parent_id            text,
  raw                  jsonb
);
-- ======================
-- DATASTORE: Record
-- ======================
CREATE TABLE unified_datastore_record (
  unified_connection_id  text NOT NULL,
  unified_webhook_id     text NOT NULL,
  unified_external_xref  text,
  unified_integration_type text NOT NULL,
  unified_raw_id         text,
  unified_id             text NOT NULL,
  id                   text,
  created_at           timestamptz,
  updated_at           timestamptz,
  database_id          text,
  table_id             text,
  fields               jsonb,
  row_number           numeric,
  raw                  jsonb
);
