Skip to content

Commit

Permalink
On delete DO_NOTHING
Browse files Browse the repository at this point in the history
  • Loading branch information
stacimc committed Jun 24, 2024
1 parent a082bce commit 0af7605
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Generated by Django 4.2.11 on 2024-06-20 19:51
# Generated by Django 4.2.11 on 2024-06-24 17:47

from django.db import migrations, models
import django.db.models.deletion
Expand All @@ -14,11 +14,11 @@ class Migration(migrations.Migration):
migrations.AlterField(
model_name='audiodecisionthrough',
name='media_obj',
field=models.ForeignKey(db_column='identifier', db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='api.audio', to_field='identifier'),
field=models.ForeignKey(db_column='identifier', db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='api.audio', to_field='identifier'),
),
migrations.AlterField(
model_name='imagedecisionthrough',
name='media_obj',
field=models.ForeignKey(db_column='identifier', db_constraint=False, on_delete=django.db.models.deletion.CASCADE, to='api.image', to_field='identifier'),
field=models.ForeignKey(db_column='identifier', db_constraint=False, on_delete=django.db.models.deletion.DO_NOTHING, to='api.image', to_field='identifier'),
),
]
2 changes: 1 addition & 1 deletion api/api/models/audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ class AudioDecisionThrough(AbstractMediaDecisionThrough):
media_obj = models.ForeignKey(
Audio,
to_field="identifier",
on_delete=models.CASCADE,
on_delete=models.DO_NOTHING,
db_column="identifier",
db_constraint=False,
)
Expand Down
2 changes: 1 addition & 1 deletion api/api/models/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class ImageDecisionThrough(AbstractMediaDecisionThrough):
media_obj = models.ForeignKey(
Image,
to_field="identifier",
on_delete=models.CASCADE,
on_delete=models.DO_NOTHING,
db_column="identifier",
db_constraint=False,
)
Expand Down
2 changes: 1 addition & 1 deletion api/api/models/media.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@ class AbstractMediaDecisionThrough(models.Model):
media_obj = models.ForeignKey(
AbstractMedia,
to_field="identifier",
on_delete=models.CASCADE,
on_delete=models.DO_NOTHING,
db_column="identifier",
db_constraint=False,
)
Expand Down

0 comments on commit 0af7605

Please sign in to comment.