-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix!(models): modify on_delete behaviour for instrument, avresource, …
…instrumentname models - On the Instrument model, set default_image and thumbnail to NULL if related AVResource object is deleted. - On the InstrumentName model, delete the InstrumentName if the related Instrument is deleted. - On the AVResource model, set the instrument field to NULL if the related Instrument is deleted.
- Loading branch information
Showing
4 changed files
with
38 additions
and
4 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
web-app/django/VIM/apps/instruments/migrations/0003_alter_avresource_instrument_and_more.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Generated by Django 4.2.5 on 2024-08-14 22:18 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('instruments', '0002_instrument_thumbnail'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='avresource', | ||
name='instrument', | ||
field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='instruments.instrument'), | ||
), | ||
migrations.AlterField( | ||
model_name='instrument', | ||
name='default_image', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='default_image_of', to='instruments.avresource'), | ||
), | ||
migrations.AlterField( | ||
model_name='instrument', | ||
name='thumbnail', | ||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='thumbnail_of', to='instruments.avresource'), | ||
), | ||
migrations.AlterField( | ||
model_name='instrumentname', | ||
name='instrument', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='instruments.instrument'), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters