Files
documenso/packages/prisma/migrations/20231017042227_fix_typo/migration.sql
Ephraim Atta-Duncan 31a9127c9e feat: templates
2023-12-14 12:24:56 +11:00

24 lines
1.0 KiB
SQL

/*
Warnings:
- You are about to drop the column `tempateDocumentDataId` on the `Template` table. All the data in the column will be lost.
- A unique constraint covering the columns `[templateDocumentDataId]` on the table `Template` will be added. If there are existing duplicate values, this will fail.
- Added the required column `templateDocumentDataId` to the `Template` table without a default value. This is not possible if the table is not empty.
*/
-- DropForeignKey
ALTER TABLE "Template" DROP CONSTRAINT "Template_tempateDocumentDataId_fkey";
-- DropIndex
DROP INDEX "Template_tempateDocumentDataId_key";
-- AlterTable
ALTER TABLE "Template" DROP COLUMN "tempateDocumentDataId",
ADD COLUMN "templateDocumentDataId" TEXT NOT NULL;
-- CreateIndex
CREATE UNIQUE INDEX "Template_templateDocumentDataId_key" ON "Template"("templateDocumentDataId");
-- AddForeignKey
ALTER TABLE "Template" ADD CONSTRAINT "Template_templateDocumentDataId_fkey" FOREIGN KEY ("templateDocumentDataId") REFERENCES "DocumentData"("id") ON DELETE CASCADE ON UPDATE CASCADE;