X-Git-Url: https://git.mdrn.pl/redakcja.git/blobdiff_plain/69b332800a472211b5da70426171fa429702a273..0b1bf765d6185ef20235e702b2969d951bca4de5:/src/depot/migrations/0009_sitebook_sitebookpublish_site_book.py diff --git a/src/depot/migrations/0009_sitebook_sitebookpublish_site_book.py b/src/depot/migrations/0009_sitebook_sitebookpublish_site_book.py new file mode 100644 index 00000000..a6aeb18f --- /dev/null +++ b/src/depot/migrations/0009_sitebook_sitebookpublish_site_book.py @@ -0,0 +1,58 @@ +# Generated by Django 4.1.9 on 2023-09-05 14:13 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ("documents", "0011_book_woblink_id"), + ("depot", "0008_rename_shop_site"), + ] + + operations = [ + migrations.CreateModel( + name="SiteBook", + fields=[ + ( + "id", + models.AutoField( + auto_created=True, + primary_key=True, + serialize=False, + verbose_name="ID", + ), + ), + ("external_id", models.CharField(blank=True, max_length=255)), + ("created_at", models.DateTimeField(auto_now_add=True)), + ( + "book", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, to="documents.book" + ), + ), + ( + "site", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + to="depot.site", + ), + ), + ], + options={ + "unique_together": {("book", "site")}, + }, + ), + migrations.AddField( + model_name="sitebookpublish", + name="site_book", + field=models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.PROTECT, + to="depot.sitebook", + ), + ), + ]