Files
GibSend/apps/web/prisma/migrations/20250207104036_add_template/migration.sql
Ganapathy S 38314a35dc feat: add templates for transactional emails (#103)
* add template migration & router

* template CRUD

* templated transactional emails API

* zod schema fix & rearranging template columns
2025-03-08 23:05:28 +11:00

20 lines
596 B
SQL

-- CreateTable
CREATE TABLE "Template" (
"id" TEXT NOT NULL,
"name" TEXT NOT NULL,
"teamId" INTEGER NOT NULL,
"subject" TEXT NOT NULL,
"html" TEXT,
"content" TEXT,
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" TIMESTAMP(3) NOT NULL,
CONSTRAINT "Template_pkey" PRIMARY KEY ("id")
);
-- CreateIndex
CREATE INDEX "Template_createdAt_idx" ON "Template"("createdAt" DESC);
-- AddForeignKey
ALTER TABLE "Template" ADD CONSTRAINT "Template_teamId_fkey" FOREIGN KEY ("teamId") REFERENCES "Team"("id") ON DELETE CASCADE ON UPDATE CASCADE;