fix
authorRadek Czajka <rczajka@rczajka.pl>
Mon, 2 Nov 2020 13:03:53 +0000 (14:03 +0100)
committerRadek Czajka <rczajka@rczajka.pl>
Mon, 2 Nov 2020 13:03:53 +0000 (14:03 +0100)
src/documents/migrations/0003_auto_20201102_1324.py
src/documents/migrations/0005_auto_20201102_1340.py
src/documents/models/book.py

index 79c3073..5292fa6 100644 (file)
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='book',
             name='dc_slug',
         migrations.AlterField(
             model_name='book',
             name='dc_slug',
-            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='catalogue.Book', to_field='slug'),
+            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, to='catalogue.Book', to_field='slug', db_constraint=False),
         ),
     ]
         ),
     ]
index 0731fa8..eb6e493 100644 (file)
@@ -15,6 +15,6 @@ class Migration(migrations.Migration):
         migrations.AlterField(
             model_name='book',
             name='catalogue_book',
         migrations.AlterField(
             model_name='book',
             name='catalogue_book',
-            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='document_books', related_query_name='document_book', to='catalogue.Book', to_field='slug'),
+            field=models.ForeignKey(blank=True, editable=False, null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='document_books', related_query_name='document_book', to='catalogue.Book', to_field='slug', db_constraint=False),
         ),
     ]
         ),
     ]
index e16de68..75e707e 100644 (file)
@@ -45,6 +45,7 @@ class Book(models.Model):
         models.DO_NOTHING,
         to_field='slug',
         null=True, blank=True,
         models.DO_NOTHING,
         to_field='slug',
         null=True, blank=True,
+        db_constraint=False,
         editable=False, db_index=True,
         related_name='document_books',
         related_query_name='document_book',
         editable=False, db_index=True,
         related_name='document_books',
         related_query_name='document_book',