mirror of
https://github.com/documenso/documenso.git
synced 2025-11-18 10:42:01 +10:00
Merge branch 'main' of https://github.com/documenso/documenso into feat/redirect-templates
This commit is contained in:
@ -0,0 +1,13 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "Recipient" ADD COLUMN "documentDeletedAt" TIMESTAMP(3);
|
||||
|
||||
-- Hard delete all PENDING documents that have been soft deleted
|
||||
DELETE FROM "Document" WHERE "deletedAt" IS NOT NULL AND "status" = 'PENDING';
|
||||
|
||||
-- Update all recipients who are the owner of the document and where the document has deletedAt set to not null
|
||||
UPDATE "Recipient"
|
||||
SET "documentDeletedAt" = "Document"."deletedAt"
|
||||
FROM "Document", "User"
|
||||
WHERE "Recipient"."documentId" = "Document"."id"
|
||||
AND "Recipient"."email" = "User"."email"
|
||||
AND "Document"."deletedAt" IS NOT NULL;
|
||||
@ -0,0 +1,11 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- Made the column `recipientId` on table `Field` required. This step will fail if there are existing NULL values in that column.
|
||||
|
||||
*/
|
||||
-- Drop all Fields where the recipientId is null
|
||||
DELETE FROM "Field" WHERE "recipientId" IS NULL;
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "Field" ALTER COLUMN "recipientId" SET NOT NULL;
|
||||
@ -0,0 +1,23 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "PasswordResetToken" DROP CONSTRAINT "PasswordResetToken_userId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Signature" DROP CONSTRAINT "Signature_fieldId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "Team" DROP CONSTRAINT "Team_ownerUserId_fkey";
|
||||
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "TeamMember" DROP CONSTRAINT "TeamMember_userId_fkey";
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "PasswordResetToken" ADD CONSTRAINT "PasswordResetToken_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Signature" ADD CONSTRAINT "Signature_fieldId_fkey" FOREIGN KEY ("fieldId") REFERENCES "Field"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "Team" ADD CONSTRAINT "Team_ownerUserId_fkey" FOREIGN KEY ("ownerUserId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "TeamMember" ADD CONSTRAINT "TeamMember_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||
Reference in New Issue
Block a user