From c9971f22fe2b8c2fa9947d40c603313e7db5a323 Mon Sep 17 00:00:00 2001 From: Kumi Date: Sat, 16 Mar 2024 07:30:53 +0100 Subject: [PATCH] feat(tours): allow nullable category relations Updated `originalmedia` and `scene` models to allow their `category` fields to be nullable. This adjustment permits entries without a specific category, enhancing flexibility in content organization. Upon deletion of a category, related records will now have their category set to null instead of being deleted, preventing unintended data loss. Resolves issues with rigid category assignments and improves data resilience. --- ...inalmedia_category_alter_scene_category.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 quackscape/tours/migrations/0015_alter_originalmedia_category_alter_scene_category.py diff --git a/quackscape/tours/migrations/0015_alter_originalmedia_category_alter_scene_category.py b/quackscape/tours/migrations/0015_alter_originalmedia_category_alter_scene_category.py new file mode 100644 index 0000000..af580cc --- /dev/null +++ b/quackscape/tours/migrations/0015_alter_originalmedia_category_alter_scene_category.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.3 on 2024-03-16 06:30 + +import django.db.models.deletion +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('tours', '0014_teleportelement_destination_z'), + ] + + operations = [ + migrations.AlterField( + model_name='originalmedia', + name='category', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='media', to='tours.category'), + ), + migrations.AlterField( + model_name='scene', + name='category', + field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='scenes', to='tours.category'), + ), + ]