# Generated by Django 4.1.3 on 2023-05-21 16:09 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('metaservicesynced', '0001_initial'), ] operations = [ migrations.CreateModel( name='Achievement', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('time_received', models.DateTimeField(auto_now_add=True)), ], options={ 'verbose_name': 'достижение пользователя', 'verbose_name_plural': 'достижения пользователя', 'db_table': 'achievement', }, ), migrations.CreateModel( name='Achievements', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(help_text='Название достижения', max_length=128)), ('description', models.CharField(help_text='Описание достижения, за что получается', max_length=255)), ('image', models.ImageField(help_text='статичная картинка достижения', upload_to='sports/achievements/')), ('image_animated', models.ImageField(blank=True, help_text='анимированная картинка достижения. Если отсутствует, то используется статичная картинка', null=True, upload_to='sports/achievements/')), ('value', models.FloatField(default=0, help_text='Очки за выполение')), ], options={ 'verbose_name': 'достижения', 'verbose_name_plural': 'достижения', 'db_table': 'achievements', }, ), migrations.CreateModel( name='BlockedSportsman', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ], options={ 'verbose_name': 'заблокированный ползователь', 'verbose_name_plural': 'заблокированные пользователи', 'db_table': 'blocked_sportsman', }, ), migrations.CreateModel( name='BrowseEvent', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('time_browsed', models.DateTimeField(auto_now_add=True, help_text='Для сортировки объектов после соединения browseEvent и browseUser')), ], options={ 'verbose_name': 'просмотренное мероприятие', 'verbose_name_plural': 'просмотренные мероприятия', 'db_table': 'browse_event', }, ), migrations.CreateModel( name='BrowseSportsman', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('time_browsed', models.DateTimeField(auto_now_add=True, help_text='Для сортировки объектов после соединения browseEvent и browseUser')), ], options={ 'verbose_name': 'просмотренный пользователь', 'verbose_name_plural': 'просмотренные пользователи', 'db_table': 'browse_sportsman', }, ), migrations.CreateModel( name='Event', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('required_gender', models.CharField(blank=True, choices=[('M', 'Мужчина'), ('F', 'Женщина')], default=None, max_length=1, null=True)), ('description', models.CharField(blank=True, max_length=512)), ('time_updated', models.DateTimeField(auto_now=True, null=True)), ('time_close', models.DateTimeField(blank=True, null=True)), ('max_participants', models.IntegerField(help_text='максимальное количесво участников')), ('min_participants', models.IntegerField(help_text='минимальное количесво участников')), ('max_age', models.IntegerField(help_text='максимальный возраст для участия')), ('min_age', models.IntegerField(help_text='минимальный возраст для участия')), ('required_level', models.IntegerField(blank=True, help_text='необходимое минимальное значение в поле level у пользователя для участия', null=True)), ('location', models.CharField(max_length=100)), ('event_place_start', models.CharField(max_length=128)), ('event_place_finish_prediction', models.CharField(blank=True, max_length=128, null=True)), ('event_place_finish_real', models.CharField(blank=True, max_length=128, null=True)), ('is_public', models.BooleanField(default=True)), ], options={ 'verbose_name': 'мероприятие', 'verbose_name_plural': 'мероприятия', 'db_table': 'event', }, ), migrations.CreateModel( name='Participant', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('is_finished', models.BooleanField(default=False)), ('event_participant', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='event_participant', to='sports.event')), ], options={ 'verbose_name': 'участник', 'verbose_name_plural': 'участники', 'db_table': 'participant', }, ), migrations.CreateModel( name='SavedEvent', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('event_savedevent', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='event_savedevent', to='sports.event')), ], options={ 'verbose_name': 'сохранённое мероприятие', 'verbose_name_plural': 'сохранённые мероприятия', 'db_table': 'saved_event', }, ), migrations.CreateModel( name='SavedSportsman', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ], options={ 'verbose_name': 'сохранённый ползователь', 'verbose_name_plural': 'сохранённые пользователи', 'db_table': 'saved_sportsman', }, ), migrations.CreateModel( name='Sport', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('title', models.CharField(max_length=128)), ('image', models.ImageField(help_text='иконка вида спорта', upload_to='sports/sport/')), ], options={ 'verbose_name': 'вид спорта', 'verbose_name_plural': 'виды спорта', 'db_table': 'sport', }, ), migrations.CreateModel( name='SportPreferrence', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('sport', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sport', to='sports.sport')), ], options={ 'verbose_name': 'предпочитаемый вид спорта', 'verbose_name_plural': 'предпочитаемые виды спорта', 'db_table': 'sport_preferrence', }, ), migrations.CreateModel( name='Sportsman', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('bio', models.CharField(blank=True, max_length=512)), ('level', models.FloatField(default=0)), ('birthdate', models.DateField(blank=True, null=True)), ('active_status', models.CharField(default='Active', max_length=64)), ('time_updated', models.DateTimeField(blank=True, null=True)), ('preferred_time', models.CharField(blank=True, help_text='список дней и времени', max_length=128)), ('reliance_rating', models.FloatField(default=0)), ('gender', models.CharField(blank=True, choices=[('M', 'Мужчина'), ('F', 'Женщина')], default=None, max_length=1, null=True)), ('achievement', models.ManyToManyField(through='sports.Achievement', to='sports.achievements')), ('blocked_sportsman', models.ManyToManyField(through='sports.BlockedSportsman', to='sports.sportsman')), ('browse_event', models.ManyToManyField(related_name='sportsman_browseevent', through='sports.BrowseEvent', to='sports.event')), ('browse_sportsman', models.ManyToManyField(through='sports.BrowseSportsman', to='sports.sportsman')), ('client', models.ForeignKey(help_text='клиент, которому соответствует роль спортсмена', on_delete=django.db.models.deletion.DO_NOTHING, to='metaservicesynced.client')), ('participant', models.ManyToManyField(related_name='sportsman_participant', through='sports.Participant', to='sports.event')), ('saved_event', models.ManyToManyField(through='sports.SavedEvent', to='sports.event')), ('saved_sportsman', models.ManyToManyField(through='sports.SavedSportsman', to='sports.sportsman')), ('sport_preferrence', models.ManyToManyField(through='sports.SportPreferrence', to='sports.sport')), ], options={ 'verbose_name': 'Спортсмена', 'verbose_name_plural': 'Спортсмены', 'db_table': 'sportsman', }, ), migrations.CreateModel( name='SportsmanGallery', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.ImageField(upload_to='sports/sportsman/%Y/%m/%d/')), ('sportsman', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='sports.sportsman')), ], options={ 'verbose_name': 'фото пользователя', 'verbose_name_plural': 'фото пользователя', 'db_table': 'sportsman_gallery', }, ), migrations.AddField( model_name='sportpreferrence', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_sportpreferrence', to='sports.sportsman'), ), migrations.AddField( model_name='savedsportsman', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_savedsportsman', to='sports.sportsman'), ), migrations.AddField( model_name='savedsportsman', name='sportsman_saved', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_saved', to='sports.sportsman'), ), migrations.AddField( model_name='savedevent', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_savedevent', to='sports.sportsman'), ), migrations.AddField( model_name='participant', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_participant', to='sports.sportsman'), ), migrations.CreateModel( name='EventGallery', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('image', models.ImageField(upload_to='sports/event/')), ('event', models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='sports.event')), ], options={ 'verbose_name': 'фото мероприятия', 'verbose_name_plural': 'фото мероприятия', 'db_table': 'event_gallery', }, ), migrations.AddField( model_name='event', name='host', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='sports.sportsman'), ), migrations.AddField( model_name='event', name='orders', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='metaservicesynced.orders'), ), migrations.AddField( model_name='event', name='sport', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='sports.sport'), ), migrations.AddField( model_name='browsesportsman', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_browsesportsman', to='sports.sportsman'), ), migrations.AddField( model_name='browsesportsman', name='sportsman_browsed', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_browsed', to='sports.sportsman'), ), migrations.AddField( model_name='browseevent', name='event_browseevent', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='event_browseevent', to='sports.event'), ), migrations.AddField( model_name='browseevent', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_browseevent', to='sports.sportsman'), ), migrations.AddField( model_name='blockedsportsman', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_blockedsportsman', to='sports.sportsman'), ), migrations.AddField( model_name='blockedsportsman', name='sportsman_blocked', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_blocked', to='sports.sportsman'), ), migrations.AddField( model_name='achievement', name='achievement', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='achievement', to='sports.achievements'), ), migrations.AddField( model_name='achievement', name='sportsman', field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, related_name='sportsman_achievement', to='sports.sportsman'), ), migrations.AddConstraint( model_name='sportpreferrence', constraint=models.UniqueConstraint(fields=('sportsman', 'sport'), name='unique_sportpreferrence'), ), migrations.AddConstraint( model_name='savedsportsman', constraint=models.UniqueConstraint(fields=('sportsman', 'sportsman_saved'), name='unique_saved_sportsman'), ), migrations.AddConstraint( model_name='savedevent', constraint=models.UniqueConstraint(fields=('sportsman', 'event_savedevent'), name='unique_saved_event'), ), migrations.AddConstraint( model_name='participant', constraint=models.UniqueConstraint(fields=('sportsman', 'event_participant'), name='unique_participant'), ), migrations.AddConstraint( model_name='browsesportsman', constraint=models.UniqueConstraint(fields=('sportsman', 'sportsman_browsed'), name='unique_browse_sportsman'), ), migrations.AddConstraint( model_name='browseevent', constraint=models.UniqueConstraint(fields=('sportsman', 'event_browseevent'), name='unique_browse_event'), ), migrations.AddConstraint( model_name='blockedsportsman', constraint=models.UniqueConstraint(fields=('sportsman', 'sportsman_blocked'), name='unique_blocked_sportsman'), ), migrations.AddConstraint( model_name='achievement', constraint=models.UniqueConstraint(fields=('sportsman', 'achievement'), name='unique_achievement'), ), ]