Skip to content

Commit

Permalink
[AJP-3] migration script
Browse files Browse the repository at this point in the history
  • Loading branch information
Anna Grund authored and Anna Grund committed Dec 30, 2023
1 parent 2687ee0 commit 2789323
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions ajapaik/ajapaik/migrations/0026_auto_20231231_0026.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Generated by Django 3.2.7 on 2023-12-30 22:26

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

dependencies = [
('ajapaik', '0025_importblacklist'),
]

operations = [
migrations.CreateModel(
name='PhotoModelSuggestionResult',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('viewpoint_elevation', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Ground'), (1, 'Raised'), (2, 'Aerial')], null=True, verbose_name='Viewpoint elevation')),
('scene', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Interior'), (1, 'Exterior')], null=True, verbose_name='Scene')),
('photo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ajapaik.photo')),
],
options={
'abstract': False,
},
),
migrations.CreateModel(
name='PhotoModelSuggestionAlternativeCategory',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('created', models.DateTimeField(auto_now_add=True, db_index=True)),
('viewpoint_elevation', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Ground'), (1, 'Raised'), (2, 'Aerial')], null=True, verbose_name='Viewpoint elevation')),
('scene', models.PositiveSmallIntegerField(blank=True, choices=[(0, 'Interior'), (1, 'Exterior')], null=True, verbose_name='Scene')),
('photo', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='ajapaik.photo')),
('proposer', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='photo_scene_suggestions_alternation', to='ajapaik.profile')),
],
),
migrations.AddConstraint(
model_name='photomodelsuggestionalternativecategory',
constraint=models.UniqueConstraint(condition=models.Q(('scene__isnull', True)), fields=('proposer', 'viewpoint_elevation'), name='unique_proposer_viewpoint_elevation_without_scene'),
),
migrations.AddConstraint(
model_name='photomodelsuggestionalternativecategory',
constraint=models.UniqueConstraint(condition=models.Q(('viewpoint_elevation__isnull', True)), fields=('proposer', 'scene'), name='unique_proposer_scene_without_viewpoint_elevation'),
),
]

0 comments on commit 2789323

Please sign in to comment.