CREATE TABLE "daily_analyses" (
  "id"                TEXT      NOT NULL,
  "daily_status_id"   TEXT      NOT NULL,
  "created_at"        TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
  "file_name"         TEXT,
  "timestamp_col"     TEXT      NOT NULL,
  "note_col"          TEXT      NOT NULL,
  "classifications"   JSONB     NOT NULL,
  "total_note_rows"   INTEGER   NOT NULL,
  "sequence"          JSONB     NOT NULL,
  "category_counts"   JSONB     NOT NULL,
  "consecutive_stats" JSONB     NOT NULL,
  "runs"              JSONB     NOT NULL,
  CONSTRAINT "daily_analyses_pkey" PRIMARY KEY ("id")
);

ALTER TABLE "daily_analyses"
  ADD CONSTRAINT "daily_analyses_daily_status_id_fkey"
  FOREIGN KEY ("daily_status_id")
  REFERENCES "daily_statuses"("id")
  ON DELETE CASCADE ON UPDATE CASCADE;
