From 0e27b260150f8c96f69075fe93c4648a6ba414da Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:55:29 -0700 Subject: [PATCH] Also make notes, share links softdelete because they cascade from doc --- ...customfieldinstance_deleted_at_and_more.py | 32 ++++++++++++++++++- src/documents/models.py | 4 +-- 2 files changed, 33 insertions(+), 3 deletions(-) diff --git a/src/documents/migrations/1056_customfieldinstance_deleted_at_and_more.py b/src/documents/migrations/1056_customfieldinstance_deleted_at_and_more.py index 2b29620db..eba1e4281 100644 --- a/src/documents/migrations/1056_customfieldinstance_deleted_at_and_more.py +++ b/src/documents/migrations/1056_customfieldinstance_deleted_at_and_more.py @@ -1,4 +1,4 @@ -# Generated by Django 5.1.2 on 2024-10-28 01:46 +# Generated by Django 5.1.2 on 2024-10-28 01:55 from django.db import migrations from django.db import models @@ -25,4 +25,34 @@ class Migration(migrations.Migration): name="transaction_id", field=models.UUIDField(blank=True, null=True), ), + migrations.AddField( + model_name="note", + name="deleted_at", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name="note", + name="restored_at", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name="note", + name="transaction_id", + field=models.UUIDField(blank=True, null=True), + ), + migrations.AddField( + model_name="sharelink", + name="deleted_at", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name="sharelink", + name="restored_at", + field=models.DateTimeField(blank=True, null=True), + ), + migrations.AddField( + model_name="sharelink", + name="transaction_id", + field=models.UUIDField(blank=True, null=True), + ), ] diff --git a/src/documents/models.py b/src/documents/models.py index e74ff318c..4528d5127 100644 --- a/src/documents/models.py +++ b/src/documents/models.py @@ -710,7 +710,7 @@ class PaperlessTask(models.Model): return f"Task {self.task_id}" -class Note(models.Model): +class Note(SoftDeleteModel): note = models.TextField( _("content"), blank=True, @@ -750,7 +750,7 @@ class Note(models.Model): return self.note -class ShareLink(models.Model): +class ShareLink(SoftDeleteModel): class FileVersion(models.TextChoices): ARCHIVE = ("archive", _("Archive")) ORIGINAL = ("original", _("Original"))