-
Notifications
You must be signed in to change notification settings - Fork 212
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use explicit through table for media/decision many-to-many field (#4310)
- Loading branch information
1 parent
ac480fd
commit f2836e0
Showing
6 changed files
with
154 additions
and
19 deletions.
There are no files selected for viewing
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,54 @@ | ||
# Generated by Django 4.2.11 on 2024-05-10 19:30 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('api', '0061_convert_varchar_to_text'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='ImageDecisionThrough', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('decision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.imagedecision')), | ||
('media_obj', models.ForeignKey(db_column='identifier', on_delete=django.db.models.deletion.CASCADE, to='api.image', to_field='identifier')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.CreateModel( | ||
name='AudioDecisionThrough', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('decision', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.audiodecision')), | ||
('media_obj', models.ForeignKey(db_column='identifier', on_delete=django.db.models.deletion.CASCADE, to='api.audio', to_field='identifier')), | ||
], | ||
options={ | ||
'abstract': False, | ||
}, | ||
), | ||
migrations.RemoveField( | ||
model_name='audiodecision', | ||
name='media_objs', | ||
), | ||
migrations.AddField( | ||
model_name='audiodecision', | ||
name='media_objs', | ||
field=models.ManyToManyField(help_text='The audio items being moderated.', through='api.AudioDecisionThrough', to='api.audio'), | ||
), | ||
migrations.RemoveField( | ||
model_name='imagedecision', | ||
name='media_objs', | ||
), | ||
migrations.AddField( | ||
model_name='imagedecision', | ||
name='media_objs', | ||
field=models.ManyToManyField(help_text='The image items being moderated.', through='api.ImageDecisionThrough', to='api.image'), | ||
), | ||
] |
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
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