]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Fix 1023, 1024 migrations, add savedviewfilterrule migration 1463/head
authorMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 26 Aug 2022 16:50:02 +0000 (09:50 -0700)
committerMichael Shamoon <4887959+shamoon@users.noreply.github.com>
Fri, 26 Aug 2022 17:02:48 +0000 (10:02 -0700)
src/documents/migrations/1023_add_comments.py
src/documents/migrations/1024_document_original_filename.py [moved from src/documents/migrations/1023_document_original_filename.py with 93% similarity]
src/documents/migrations/1024_merge_20220824_1341.py [deleted file]
src/documents/migrations/1025_alter_savedviewfilterrule_rule_type.py [new file with mode: 0644]

index 124e4777c1796134e20902352e3e732e752b62cc..2c89947e981073e6299e0ebb7dd1bda1c11ea2b3 100644 (file)
@@ -1,4 +1,6 @@
 from django.db import migrations, models
+import django.utils.timezone
+from django.conf import settings
 
 
 class Migration(migrations.Migration):
@@ -19,10 +21,49 @@ class Migration(migrations.Migration):
                         verbose_name="ID",
                     ),
                 ),
-                ("comment", models.TextField()),
-                ("created", models.DateTimeField(auto_now_add=True)),
-                ("document_id", models.PositiveIntegerField()),
-                ("user_id", models.PositiveIntegerField()),
+                (
+                    "comment",
+                    models.TextField(
+                        blank=True,
+                        help_text="Comment for the document",
+                        verbose_name="content",
+                    ),
+                ),
+                (
+                    "created",
+                    models.DateTimeField(
+                        db_index=True,
+                        default=django.utils.timezone.now,
+                        verbose_name="created",
+                    ),
+                ),
+                (
+                    "document",
+                    models.ForeignKey(
+                        blank=True,
+                        null=True,
+                        on_delete=django.db.models.deletion.CASCADE,
+                        related_name="documents",
+                        to="documents.document",
+                        verbose_name="document",
+                    ),
+                ),
+                (
+                    "user",
+                    models.ForeignKey(
+                        blank=True,
+                        null=True,
+                        on_delete=django.db.models.deletion.SET_NULL,
+                        related_name="users",
+                        to=settings.AUTH_USER_MODEL,
+                        verbose_name="user",
+                    ),
+                ),
             ],
-        )
+            options={
+                "verbose_name": "comment",
+                "verbose_name_plural": "comments",
+                "ordering": ("created",),
+            },
+        ),
     ]
similarity index 93%
rename from src/documents/migrations/1023_document_original_filename.py
rename to src/documents/migrations/1024_document_original_filename.py
index 065956bd97ad0462d7ccec1827a9bae9aa1572eb..b0f03cd507f39be4d41c4a153fc75b1bbcbef447 100644 (file)
@@ -6,7 +6,7 @@ from django.db import migrations, models
 class Migration(migrations.Migration):
 
     dependencies = [
-        ("documents", "1022_paperlesstask"),
+        ("documents", "1023_add_comments"),
     ]
 
     operations = [
diff --git a/src/documents/migrations/1024_merge_20220824_1341.py b/src/documents/migrations/1024_merge_20220824_1341.py
deleted file mode 100644 (file)
index 4a2b970..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-# Generated by Django 4.0.6 on 2022-08-24 13:41
-
-from django.db import migrations
-
-
-class Migration(migrations.Migration):
-
-    dependencies = [
-        ("documents", "1023_add_comments"),
-        ("documents", "1023_document_original_filename"),
-    ]
-
-    operations = []
diff --git a/src/documents/migrations/1025_alter_savedviewfilterrule_rule_type.py b/src/documents/migrations/1025_alter_savedviewfilterrule_rule_type.py
new file mode 100644 (file)
index 0000000..1e5b005
--- /dev/null
@@ -0,0 +1,48 @@
+# Generated by Django 4.0.5 on 2022-08-26 16:49
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ("documents", "1024_document_original_filename"),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name="savedviewfilterrule",
+            name="rule_type",
+            field=models.PositiveIntegerField(
+                choices=[
+                    (0, "title contains"),
+                    (1, "content contains"),
+                    (2, "ASN is"),
+                    (3, "correspondent is"),
+                    (4, "document type is"),
+                    (5, "is in inbox"),
+                    (6, "has tag"),
+                    (7, "has any tag"),
+                    (8, "created before"),
+                    (9, "created after"),
+                    (10, "created year is"),
+                    (11, "created month is"),
+                    (12, "created day is"),
+                    (13, "added before"),
+                    (14, "added after"),
+                    (15, "modified before"),
+                    (16, "modified after"),
+                    (17, "does not have tag"),
+                    (18, "does not have ASN"),
+                    (19, "title or content contains"),
+                    (20, "fulltext query"),
+                    (21, "more like this"),
+                    (22, "has tags in"),
+                    (23, "ASN greater than"),
+                    (24, "ASN less than"),
+                    (25, "storage path is"),
+                ],
+                verbose_name="rule type",
+            ),
+        ),
+    ]