mirror of
https://github.com/documenso/documenso.git
synced 2026-07-26 01:45:08 +10:00
fix: address per-document audit log review feedback
- backfill DocumentMeta.includeAuditLog from the effective team/org setting so documents created before the column keep embedding audit logs after deploy - default includeAuditLog in the webhook payload schema so resending historical WebhookCall payloads stays backward-compatible - allow audit-log embedding to be changed after a document is sent (drop the server guards and the editor checkbox lock) - restore the commented change-detection block in updateEnvelope
This commit is contained in:
+14
@@ -1,2 +1,16 @@
|
||||
-- AlterTable
|
||||
ALTER TABLE "DocumentMeta" ADD COLUMN "includeAuditLog" BOOLEAN NOT NULL DEFAULT false;
|
||||
|
||||
-- Backfill existing rows from the effective team/organisation setting. Before this
|
||||
-- column existed the sealing flow read `includeAuditLog` from the team settings
|
||||
-- (falling back to the organisation default), so documents created prior to this
|
||||
-- migration must keep that resolved value to avoid silently dropping audit-log
|
||||
-- embedding after deploy.
|
||||
UPDATE "DocumentMeta" AS dm
|
||||
SET "includeAuditLog" = COALESCE(tgs."includeAuditLog", ogs."includeAuditLog")
|
||||
FROM "Envelope" e
|
||||
JOIN "Team" t ON t."id" = e."teamId"
|
||||
JOIN "TeamGlobalSettings" tgs ON tgs."id" = t."teamGlobalSettingsId"
|
||||
JOIN "Organisation" o ON o."id" = t."organisationId"
|
||||
JOIN "OrganisationGlobalSettings" ogs ON ogs."id" = o."organisationGlobalSettingsId"
|
||||
WHERE e."documentMetaId" = dm."id";
|
||||
|
||||
Reference in New Issue
Block a user