CREATE TABLE "session_files" (
    "id"              TEXT         NOT NULL,
    "daily_status_id" TEXT         NOT NULL,
    "filename"        TEXT         NOT NULL,
    "file_size"       BIGINT       NOT NULL,
    "file_type"       TEXT,
    "last_modified"   BIGINT,
    "notes"           TEXT,
    "created_at"      TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,

    CONSTRAINT "session_files_pkey" PRIMARY KEY ("id")
);

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