Commit migrations, they should not be too much updated

This commit is contained in:
Yohann D'ANELLO 2020-12-28 19:30:51 +01:00
parent f1dbdde78d
commit 997b21e26a
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
3 changed files with 271 additions and 0 deletions

View File

@ -0,0 +1,95 @@
# Generated by Django 3.1.4 on 2020-12-28 17:16
import django.core.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Participation',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('valid', models.BooleanField(default=None, help_text='The video got the validation of the administrators.', null=True, verbose_name='valid')),
],
options={
'verbose_name': 'participation',
'verbose_name_plural': 'participations',
},
),
migrations.CreateModel(
name='Pool',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('round', models.PositiveSmallIntegerField(verbose_name='round')),
],
options={
'verbose_name': 'pool',
'verbose_name_plural': 'pools',
},
),
migrations.CreateModel(
name='Solution',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('problem', models.PositiveSmallIntegerField(verbose_name='problem')),
('final_solution', models.BooleanField(default=False, verbose_name='solution for the final tournament')),
('file', models.FileField(blank=True, default='', unique=True, upload_to='solutions/', verbose_name='file')),
],
options={
'verbose_name': 'solution',
'verbose_name_plural': 'solutions',
},
),
migrations.CreateModel(
name='Synthesis',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('type', models.PositiveSmallIntegerField(choices=[(1, 'opponent'), (2, 'reporter')])),
('file', models.FileField(blank=True, default='', unique=True, upload_to='syntheses/', verbose_name='file')),
],
options={
'verbose_name': 'synthesis',
'verbose_name_plural': 'syntheses',
},
),
migrations.CreateModel(
name='Team',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True, verbose_name='name')),
('trigram', models.CharField(help_text='The trigram must be composed of three uppercase letters.', max_length=3, unique=True, validators=[django.core.validators.RegexValidator('[A-Z]{3}')], verbose_name='trigram')),
('access_code', models.CharField(help_text='The access code let other people to join the team.', max_length=6, verbose_name='access code')),
],
options={
'verbose_name': 'team',
'verbose_name_plural': 'teams',
},
),
migrations.CreateModel(
name='Tournament',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=255, unique=True, verbose_name='name')),
('date_start', models.DateField(default=django.utils.timezone.now, verbose_name='start')),
('date_end', models.DateField(default=django.utils.timezone.now, verbose_name='start')),
('inscription_limit', models.DateTimeField(default=django.utils.timezone.now, verbose_name='limit date for registrations')),
('solution_limit', models.DateTimeField(default=django.utils.timezone.now, verbose_name='limit date to upload solutions')),
('syntheses_first_phase_limit', models.DateTimeField(default=django.utils.timezone.now, verbose_name='limit date to upload the syntheses for the first phase')),
('syntheses_second_phase_limit', models.DateTimeField(default=django.utils.timezone.now, verbose_name='limit date to upload the syntheses for the second phase')),
('description', models.TextField(blank=True, verbose_name='description')),
('final', models.BooleanField(default=False, verbose_name='final')),
],
options={
'verbose_name': 'tournament',
'verbose_name_plural': 'tournaments',
},
),
]

View File

@ -0,0 +1,78 @@
# Generated by Django 3.1.4 on 2020-12-28 17:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('participation', '0001_initial'),
('registration', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='tournament',
name='organizers',
field=models.ManyToManyField(related_name='organized_tournaments', to='registration.VolunteerRegistration', verbose_name='organizers'),
),
migrations.AddIndex(
model_name='team',
index=models.Index(fields=['trigram'], name='participati_trigram_239255_idx'),
),
migrations.AddField(
model_name='synthesis',
name='participation',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='participation.participation', verbose_name='participation'),
),
migrations.AddField(
model_name='synthesis',
name='pool',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='syntheses', to='participation.pool', verbose_name='pool'),
),
migrations.AddField(
model_name='solution',
name='participation',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='solutions', to='participation.participation', verbose_name='participation'),
),
migrations.AddField(
model_name='pool',
name='juries',
field=models.ManyToManyField(related_name='jury_in', to='registration.VolunteerRegistration', verbose_name='juries'),
),
migrations.AddField(
model_name='pool',
name='participations',
field=models.ManyToManyField(related_name='pools', to='participation.Participation', verbose_name='participations'),
),
migrations.AddField(
model_name='pool',
name='tournament',
field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='pools', to='participation.tournament', verbose_name='tournament'),
),
migrations.AddField(
model_name='participation',
name='team',
field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='participation.team', verbose_name='team'),
),
migrations.AddField(
model_name='participation',
name='tournament',
field=models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.SET_NULL, to='participation.tournament', verbose_name='tournament'),
),
migrations.AddIndex(
model_name='tournament',
index=models.Index(fields=['name', 'date_start', 'date_end'], name='participati_name_b43174_idx'),
),
migrations.AlterUniqueTogether(
name='synthesis',
unique_together={('participation', 'pool', 'type')},
),
migrations.AlterUniqueTogether(
name='solution',
unique_together={('participation', 'problem', 'final_solution')},
),
]

View File

@ -0,0 +1,98 @@
# Generated by Django 3.1.4 on 2020-12-28 17:16
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import registration.models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('participation', '0001_initial'),
('contenttypes', '0002_remove_content_type_name'),
]
operations = [
migrations.CreateModel(
name='Registration',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('give_contact_to_animath', models.BooleanField(default=False, verbose_name='Grant Animath to contact me in the future about other actions')),
('email_confirmed', models.BooleanField(default=False, verbose_name='email confirmed')),
('polymorphic_ctype', models.ForeignKey(editable=False, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='polymorphic_registration.registration_set+', to='contenttypes.contenttype')),
('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL, verbose_name='user')),
],
options={
'verbose_name': 'registration',
'verbose_name_plural': 'registrations',
},
),
migrations.CreateModel(
name='AdminRegistration',
fields=[
('registration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration.registration')),
('role', models.TextField(verbose_name='role of the administrator')),
],
options={
'verbose_name': 'admin registration',
'verbose_name_plural': 'admin registrations',
},
bases=('registration.registration',),
),
migrations.CreateModel(
name='ParticipantRegistration',
fields=[
('registration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration.registration')),
('photo_authorization', models.FileField(blank=True, default='', upload_to=registration.models.get_random_photo_filename, verbose_name='photo authorization')),
('health_sheet', models.FileField(blank=True, default='', upload_to=registration.models.get_random_health_filename, verbose_name='health sheet')),
('team', models.ForeignKey(blank=True, default=None, null=True, on_delete=django.db.models.deletion.PROTECT, related_name='participants', to='participation.team', verbose_name='team')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('registration.registration',),
),
migrations.CreateModel(
name='VolunteerRegistration',
fields=[
('registration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration.registration')),
('professional_activity', models.TextField(verbose_name='professional activity')),
],
options={
'abstract': False,
'base_manager_name': 'objects',
},
bases=('registration.registration',),
),
migrations.CreateModel(
name='CoachRegistration',
fields=[
('participantregistration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration.participantregistration')),
('professional_activity', models.TextField(verbose_name='professional activity')),
],
options={
'verbose_name': 'coach registration',
'verbose_name_plural': 'coach registrations',
},
bases=('registration.participantregistration',),
),
migrations.CreateModel(
name='StudentRegistration',
fields=[
('participantregistration_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='registration.participantregistration')),
('student_class', models.IntegerField(choices=[(12, '12th grade'), (11, '11th grade'), (10, '10th grade or lower')], verbose_name='student class')),
('school', models.CharField(max_length=255, verbose_name='school')),
('parental_authorization', models.FileField(blank=True, default='', upload_to=registration.models.get_random_parental_filename, verbose_name='parental authorization')),
],
options={
'verbose_name': 'student registration',
'verbose_name_plural': 'student registrations',
},
bases=('registration.participantregistration',),
),
]