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.
This commit is contained in:
parent
2bbb39860e
commit
c9971f22fe
1 changed files with 24 additions and 0 deletions
|
@ -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'),
|
||||
),
|
||||
]
|
Loading…
Reference in a new issue