stock-management-demo/prisma/migrations/20250427210427_add_mantis_notes/migration.sql

20 lines
710 B
SQL

-- CreateTable
CREATE TABLE "MantisNote" (
"id" SERIAL NOT NULL,
"mantis_issue_id" INTEGER NOT NULL,
"content" TEXT NOT NULL,
"created_by" TEXT NOT NULL,
"created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updated_at" TIMESTAMP(3) NOT NULL,
CONSTRAINT "MantisNote_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "MantisNote_mantis_issue_id_idx" ON "MantisNote"("mantis_issue_id");
-- CreateIndex
CREATE INDEX "MantisNote_created_by_idx" ON "MantisNote"("created_by");
-- AddForeignKey
ALTER TABLE "MantisNote" ADD CONSTRAINT "MantisNote_mantis_issue_id_fkey" FOREIGN KEY ("mantis_issue_id") REFERENCES "MantisIssue"("id") ON DELETE CASCADE ON UPDATE CASCADE;