We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[BUG] Rollback doesn't work as described in the documentation
### Description

Rollback doesn't work properly as described in the documentation.

### Steps to reproduce

1. Go to 'https://docs.paperless-ngx.com/setup/#moving-back-to-paperless'
2. Open a terminal from the container and execute the command like mentioned at 'Or without docker:'
3. Error

### Webserver logs

```bash
root@ad747fe4e9e8:/usr/src/paperless/src# python3 manage.py migrate documents 0023
Operations to perform:
  Target specific migration: 0023_document_current_filename, from documents
Running migrations:
  Rendering model states... DONE
  Unapplying paperless_mail.0016_mailrule_consumption_scope... OK
  Unapplying paperless_mail.0015_alter_mailrule_action... OK
  Unapplying paperless_mail.0014_alter_mailrule_action... OK
  Unapplying paperless_mail.0013_merge_20220412_1051... OK
  Unapplying paperless_mail.0012_alter_mailrule_assign_tags... OK
  Unapplying paperless_mail.0011_remove_mailrule_assign_tag... OK
  Unapplying paperless_mail.0010_auto_20220311_1602... OK
  Unapplying paperless_mail.0009_mailrule_assign_tags... OK
  Unapplying paperless_mail.0009_alter_mailrule_action_alter_mailrule_folder... OK
  Unapplying paperless_mail.0008_auto_20210516_0940... OK
  Unapplying paperless_mail.0007_auto_20210106_0138... OK
  Unapplying paperless_mail.0006_auto_20210101_2340... OK
  Unapplying paperless_mail.0005_help_texts... OK
  Unapplying paperless_mail.0004_mailrule_order... OK
  Unapplying paperless_mail.0003_auto_20201118_1940... OK
  Unapplying paperless_mail.0002_auto_20201117_1334... OK
  Unapplying paperless_mail.0001_initial... OK
  Unapplying documents.1028_remove_paperlesstask_task_args_and_more... OK
  Unapplying documents.1027_remove_paperlesstask_attempted_task_and_more... OK
  Unapplying documents.1026_transition_to_celery...Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)
sqlite3.IntegrityError: NOT NULL constraint failed: new__documents_paperlesstask.name

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/paperless/src/manage.py", line 11, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 446, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py", line 440, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 402, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 448, in execute
    output = self.handle(*args, **options)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/base.py", line 96, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/local/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 349, in handle
    post_migrate_state = executor.migrate(
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 141, in migrate
    state = self._migrate_all_backwards(plan, full_plan, fake=fake)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 219, in _migrate_all_backwards
    self.unapply_migration(states[migration], migration, fake=fake)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py", line 279, in unapply_migration
    state = migration.unapply(state, schema_editor)
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/migration.py", line 191, in unapply
    operation.database_backwards(
  File "/usr/local/lib/python3.9/site-packages/django/db/migrations/operations/fields.py", line 178, in database_backwards
    schema_editor.add_field(from_model, to_model._meta.get_field(self.name))
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/schema.py", line 397, in add_field
    self._remake_table(model, create_field=field)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/schema.py", line 333, in _remake_table
    self.execute(
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/base/schema.py", line 199, in execute
    cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 67, in execute
    return self._execute_with_wrappers(
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 80, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/django/db/utils.py", line 91, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py", line 89, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py", line 357, in execute
    return Database.Cursor.execute(self, query, params)
django.db.utils.IntegrityError: NOT NULL constraint failed: new__documents_paperlesstask.name
```


### Browser logs

_No response_

### Paperless-ngx version

1.11.3

### Host OS

Unraid 6.11.5

### Installation method

Docker - official image

### Browser

Firefox

### Configuration changes

_No response_

### Other

_No response_

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `src/documents/migrations/1022_paperlesstask.py`
Content:
```
1 # Generated by Django 4.0.4 on 2022-05-23 07:14
2 
3 from django.db import migrations, models
4 import django.db.models.deletion
5 
6 
7 class Migration(migrations.Migration):
8 
9     dependencies = [
10         ("documents", "1021_webp_thumbnail_conversion"),
11     ]
12 
13     operations = [
14         migrations.CreateModel(
15             name="PaperlessTask",
16             fields=[
17                 (
18                     "id",
19                     models.AutoField(
20                         auto_created=True,
21                         primary_key=True,
22                         serialize=False,
23                         verbose_name="ID",
24                     ),
25                 ),
26                 ("task_id", models.CharField(max_length=128)),
27                 ("name", models.CharField(max_length=256)),
28                 (
29                     "created",
30                     models.DateTimeField(auto_now=True, verbose_name="created"),
31                 ),
32                 (
33                     "started",
34                     models.DateTimeField(null=True, verbose_name="started"),
35                 ),
36                 ("acknowledged", models.BooleanField(default=False)),
37                 (
38                     "attempted_task",
39                     models.OneToOneField(
40                         blank=True,
41                         null=True,
42                         on_delete=django.db.models.deletion.CASCADE,
43                         related_name="attempted_task",
44                         # This is a dummy field, 1026 will fix up the column
45                         # This manual change is required, as django doesn't django doesn't really support
46                         # removing an app which has migration deps like this
47                         to="documents.document",
48                     ),
49                 ),
50             ],
51         )
52     ]
53
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/src/documents/migrations/1022_paperlesstask.py b/src/documents/migrations/1022_paperlesstask.py
--- a/src/documents/migrations/1022_paperlesstask.py
+++ b/src/documents/migrations/1022_paperlesstask.py
@@ -24,7 +24,7 @@
                     ),
                 ),
                 ("task_id", models.CharField(max_length=128)),
-                ("name", models.CharField(max_length=256)),
+                ("name", models.CharField(max_length=256, null=True)),
                 (
                     "created",
                     models.DateTimeField(auto_now=True, verbose_name="created"),

{"golden_diff": "diff --git a/src/documents/migrations/1022_paperlesstask.py b/src/documents/migrations/1022_paperlesstask.py\n--- a/src/documents/migrations/1022_paperlesstask.py\n+++ b/src/documents/migrations/1022_paperlesstask.py\n@@ -24,7 +24,7 @@\n                     ),\n                 ),\n                 (\"task_id\", models.CharField(max_length=128)),\n-                (\"name\", models.CharField(max_length=256)),\n+                (\"name\", models.CharField(max_length=256, null=True)),\n                 (\n                     \"created\",\n                     models.DateTimeField(auto_now=True, verbose_name=\"created\"),\n", "issue": "[BUG] Rollback doesn't work as described in the documentation\n### Description\n\nRollback doesn't work properly as described in the documentation.\n\n### Steps to reproduce\n\n1. Go to 'https://docs.paperless-ngx.com/setup/#moving-back-to-paperless'\r\n2. Open a terminal from the container and execute the command like mentioned at 'Or without docker:'\r\n3. Error\n\n### Webserver logs\n\n```bash\nroot@ad747fe4e9e8:/usr/src/paperless/src# python3 manage.py migrate documents 0023\r\nOperations to perform:\r\n  Target specific migration: 0023_document_current_filename, from documents\r\nRunning migrations:\r\n  Rendering model states... DONE\r\n  Unapplying paperless_mail.0016_mailrule_consumption_scope... OK\r\n  Unapplying paperless_mail.0015_alter_mailrule_action... OK\r\n  Unapplying paperless_mail.0014_alter_mailrule_action... OK\r\n  Unapplying paperless_mail.0013_merge_20220412_1051... OK\r\n  Unapplying paperless_mail.0012_alter_mailrule_assign_tags... OK\r\n  Unapplying paperless_mail.0011_remove_mailrule_assign_tag... OK\r\n  Unapplying paperless_mail.0010_auto_20220311_1602... OK\r\n  Unapplying paperless_mail.0009_mailrule_assign_tags... OK\r\n  Unapplying paperless_mail.0009_alter_mailrule_action_alter_mailrule_folder... OK\r\n  Unapplying paperless_mail.0008_auto_20210516_0940... OK\r\n  Unapplying paperless_mail.0007_auto_20210106_0138... OK\r\n  Unapplying paperless_mail.0006_auto_20210101_2340... OK\r\n  Unapplying paperless_mail.0005_help_texts... OK\r\n  Unapplying paperless_mail.0004_mailrule_order... OK\r\n  Unapplying paperless_mail.0003_auto_20201118_1940... OK\r\n  Unapplying paperless_mail.0002_auto_20201117_1334... OK\r\n  Unapplying paperless_mail.0001_initial... OK\r\n  Unapplying documents.1028_remove_paperlesstask_task_args_and_more... OK\r\n  Unapplying documents.1027_remove_paperlesstask_attempted_task_and_more... OK\r\n  Unapplying documents.1026_transition_to_celery...Traceback (most recent call last):\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py\", line 89, in _execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py\", line 357, in execute\r\n    return Database.Cursor.execute(self, query, params)\r\nsqlite3.IntegrityError: NOT NULL constraint failed: new__documents_paperlesstask.name\r\n\r\nThe above exception was the direct cause of the following exception:\r\n\r\nTraceback (most recent call last):\r\n  File \"/usr/src/paperless/src/manage.py\", line 11, in <module>\r\n    execute_from_command_line(sys.argv)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py\", line 446, in execute_from_command_line\r\n    utility.execute()\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/__init__.py\", line 440, in execute\r\n    self.fetch_command(subcommand).run_from_argv(self.argv)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/base.py\", line 402, in run_from_argv\r\n    self.execute(*args, **cmd_options)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/base.py\", line 448, in execute\r\n    output = self.handle(*args, **options)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/base.py\", line 96, in wrapped\r\n    res = handle_func(*args, **kwargs)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/core/management/commands/migrate.py\", line 349, in handle\r\n    post_migrate_state = executor.migrate(\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 141, in migrate\r\n    state = self._migrate_all_backwards(plan, full_plan, fake=fake)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 219, in _migrate_all_backwards\r\n    self.unapply_migration(states[migration], migration, fake=fake)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/migrations/executor.py\", line 279, in unapply_migration\r\n    state = migration.unapply(state, schema_editor)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/migrations/migration.py\", line 191, in unapply\r\n    operation.database_backwards(\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/migrations/operations/fields.py\", line 178, in database_backwards\r\n    schema_editor.add_field(from_model, to_model._meta.get_field(self.name))\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/schema.py\", line 397, in add_field\r\n    self._remake_table(model, create_field=field)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/schema.py\", line 333, in _remake_table\r\n    self.execute(\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/base/schema.py\", line 199, in execute\r\n    cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py\", line 67, in execute\r\n    return self._execute_with_wrappers(\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py\", line 80, in _execute_with_wrappers\r\n    return executor(sql, params, many, context)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py\", line 89, in _execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/utils.py\", line 91, in __exit__\r\n    raise dj_exc_value.with_traceback(traceback) from exc_value\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/utils.py\", line 89, in _execute\r\n    return self.cursor.execute(sql, params)\r\n  File \"/usr/local/lib/python3.9/site-packages/django/db/backends/sqlite3/base.py\", line 357, in execute\r\n    return Database.Cursor.execute(self, query, params)\r\ndjango.db.utils.IntegrityError: NOT NULL constraint failed: new__documents_paperlesstask.name\n```\n\n\n### Browser logs\n\n_No response_\n\n### Paperless-ngx version\n\n1.11.3\n\n### Host OS\n\nUnraid 6.11.5\n\n### Installation method\n\nDocker - official image\n\n### Browser\n\nFirefox\n\n### Configuration changes\n\n_No response_\n\n### Other\n\n_No response_\n", "before_files": [{"content": "# Generated by Django 4.0.4 on 2022-05-23 07:14\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        (\"documents\", \"1021_webp_thumbnail_conversion\"),\n    ]\n\n    operations = [\n        migrations.CreateModel(\n            name=\"PaperlessTask\",\n            fields=[\n                (\n                    \"id\",\n                    models.AutoField(\n                        auto_created=True,\n                        primary_key=True,\n                        serialize=False,\n                        verbose_name=\"ID\",\n                    ),\n                ),\n                (\"task_id\", models.CharField(max_length=128)),\n                (\"name\", models.CharField(max_length=256)),\n                (\n                    \"created\",\n                    models.DateTimeField(auto_now=True, verbose_name=\"created\"),\n                ),\n                (\n                    \"started\",\n                    models.DateTimeField(null=True, verbose_name=\"started\"),\n                ),\n                (\"acknowledged\", models.BooleanField(default=False)),\n                (\n                    \"attempted_task\",\n                    models.OneToOneField(\n                        blank=True,\n                        null=True,\n                        on_delete=django.db.models.deletion.CASCADE,\n                        related_name=\"attempted_task\",\n                        # This is a dummy field, 1026 will fix up the column\n                        # This manual change is required, as django doesn't django doesn't really support\n                        # removing an app which has migration deps like this\n                        to=\"documents.document\",\n                    ),\n                ),\n            ],\n        )\n    ]\n", "path": "src/documents/migrations/1022_paperlesstask.py"}], "after_files": [{"content": "# Generated by Django 4.0.4 on 2022-05-23 07:14\n\nfrom django.db import migrations, models\nimport django.db.models.deletion\n\n\nclass Migration(migrations.Migration):\n\n    dependencies = [\n        (\"documents\", \"1021_webp_thumbnail_conversion\"),\n    ]\n\n    operations = [\n        migrations.CreateModel(\n            name=\"PaperlessTask\",\n            fields=[\n                (\n                    \"id\",\n                    models.AutoField(\n                        auto_created=True,\n                        primary_key=True,\n                        serialize=False,\n                        verbose_name=\"ID\",\n                    ),\n                ),\n                (\"task_id\", models.CharField(max_length=128)),\n                (\"name\", models.CharField(max_length=256, null=True)),\n                (\n                    \"created\",\n                    models.DateTimeField(auto_now=True, verbose_name=\"created\"),\n                ),\n                (\n                    \"started\",\n                    models.DateTimeField(null=True, verbose_name=\"started\"),\n                ),\n                (\"acknowledged\", models.BooleanField(default=False)),\n                (\n                    \"attempted_task\",\n                    models.OneToOneField(\n                        blank=True,\n                        null=True,\n                        on_delete=django.db.models.deletion.CASCADE,\n                        related_name=\"attempted_task\",\n                        # This is a dummy field, 1026 will fix up the column\n                        # This manual change is required, as django doesn't django doesn't really support\n                        # removing an app which has migration deps like this\n                        to=\"documents.document\",\n                    ),\n                ),\n            ],\n        )\n    ]\n", "path": "src/documents/migrations/1022_paperlesstask.py"}]}