-- CreateTable
CREATE TABLE "MantisFile" (
    "id" SERIAL NOT NULL,
    "mantis_issue_id" INTEGER NOT NULL,
    "filename" TEXT NOT NULL,
    "file_key" TEXT NOT NULL,
    "mime_type" TEXT,
    "size" INTEGER,
    "uploaded_by" TEXT,
    "uploaded_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
    "description" TEXT,

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

-- CreateIndex
CREATE INDEX "MantisFile_mantis_issue_id_idx" ON "MantisFile"("mantis_issue_id");

-- AddForeignKey
ALTER TABLE "MantisFile" ADD CONSTRAINT "MantisFile_mantis_issue_id_fkey" FOREIGN KEY ("mantis_issue_id") REFERENCES "MantisIssue"("id") ON DELETE CASCADE ON UPDATE CASCADE;
