Beispiel #1
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Department',
            fields=[
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('slug', models.SlugField(editable=False, max_length=100, primary_key=True, serialize=False)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['date_created'],
            },
        ),
        migrations.CreateModel(
            name='Faculty',
            fields=[
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('slug', models.SlugField(editable=False, max_length=100, primary_key=True, serialize=False)),
                ('date_created', models.DateTimeField(auto_now_add=True)),
            ],
            options={
                'ordering': ['date_created'],
            },
        ),
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(blank=True, default='', max_length=100)),
                ('year', models.PositiveIntegerField(choices=[(1984, 1984), (1985, 1985), (1986, 1986), (1987, 1987), (1988, 1988), (1989, 1989), (1990, 1990), (1991, 1991), (1992, 1992), (1993, 1993), (1994, 1994), (1995, 1995), (1996, 1996), (1997, 1997), (1998, 1998), (1999, 1999), (2000, 2000), (2001, 2001), (2002, 2002), (2003, 2003), (2004, 2004), (2005, 2005), (2006, 2006), (2007, 2007), (2008, 2008), (2009, 2009), (2010, 2010), (2011, 2011), (2012, 2012), (2013, 2013), (2014, 2014), (2015, 2015), (2016, 2016), (2017, 2017), (2018, 2018), (2019, 2019), (2020, 2020)], default=2020, validators=[django.core.validators.MinValueValidator(1984), api.models.max_value_current_year])),
                ('month', models.PositiveIntegerField(choices=[('1', 'January'), ('2', 'February'), ('3', 'March'), ('4', 'April'), ('5', 'May'), ('6', 'June'), ('7', 'July'), ('8', 'August'), ('9', 'September'), ('10', 'October'), ('11', 'November'), ('12', 'December')], validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(12)])),
                ('day', models.PositiveIntegerField(validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(31)])),
                ('start_time', models.TimeField(blank=True)),
                ('end_time', models.TimeField(blank=True)),
                ('slug', models.SlugField(editable=False, max_length=100)),
                ('department', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='api.department')),
                ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='events', to='api.faculty')),
            ],
        ),
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('faculty', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.faculty')),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddField(
            model_name='department',
            name='faculty',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='department', to='api.faculty'),
        ),
    ]
Beispiel #2
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='ChatMessage',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('message', models.CharField(max_length=200)),
                ('sender', models.CharField(max_length=200)),
                ('timestamp', models.TimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name='Profile',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('code',
                 models.CharField(default=api.models.gen_rand_str,
                                  max_length=30)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='BusService',
            fields=[
                ('id',
                 models.CharField(max_length=100,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('route',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=api.models.BusService.default_array_field,
                     size=None)),
                ('timing',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=20),
                     blank=True,
                     default=api.models.BusService.default_array_field,
                     size=None)),
                ('boarding_point',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(blank=True, max_length=100),
                     blank=True,
                     default=api.models.BusService.default_array_field,
                     size=None)),
                ('price', models.IntegerField(default=0)),
                ('bus_number',
                 models.CharField(blank=True, default='', max_length=20)),
                ('is_ready', models.BooleanField(default=False)),
                ('provider',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(max_length=100),
                     default=api.models.BusService.default_array_field,
                     size=None)),
                ('seats', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='HotelBooking',
            fields=[
                ('id',
                 models.CharField(max_length=100,
                                  primary_key=True,
                                  serialize=False)),
                ('service_id', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=100)),
                ('in_date', models.DateField()),
                ('out_date', models.DateField()),
                ('booking_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('rooms', models.IntegerField(default=0)),
                ('bill', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='HotelService',
            fields=[
                ('id',
                 models.CharField(max_length=100,
                                  primary_key=True,
                                  serialize=False)),
                ('name', models.CharField(max_length=100)),
                ('city',
                 models.CharField(blank=True, default='', max_length=100)),
                ('description',
                 models.CharField(blank=True,
                                  default='',
                                  max_length=1000,
                                  null=True)),
                ('area',
                 models.CharField(blank=True, default='', max_length=100)),
                ('address',
                 models.CharField(blank=True, default='', max_length=200)),
                ('check_in', models.TimeField(blank=True, null=True)),
                ('check_out', models.TimeField(blank=True, null=True)),
                ('price', models.IntegerField(default=0)),
                ('is_ready', models.BooleanField(default=False)),
                ('provider',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.CharField(max_length=100),
                     default=api.models.HotelService.default_array_field,
                     size=None)),
                ('rooms', models.IntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('email',
                 models.EmailField(max_length=100,
                                   primary_key=True,
                                   serialize=False)),
                ('password', models.CharField(max_length=500)),
                ('token', models.CharField(max_length=500)),
                ('type',
                 models.CharField(choices=[('U', 'Standard User'),
                                           ('A', 'Admin'),
                                           ('S', 'Service Provider')],
                                  max_length=1)),
                ('activated', models.BooleanField(default=False)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('email', models.EmailField(max_length=254, unique=True)),
                ('password', models.CharField(max_length=400)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FootballMatchCommentary',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('current_play_time_status', models.CharField(blank=True, choices=[('FIRST_HALF', 'FIRST_HALF'), ('SECOND_HALF', 'FIRST_HALF'), ('EXTRA_TIME', 'EXTRA TIME'), ('INJURY_TIME', 'INJURY_TIME')], max_length=200, null=True)),
                ('commentary_heading', models.TextField(blank=True, null=True)),
                ('commentary_content', models.TextField()),
                ('is_key_event', models.BooleanField(default=False)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='FootBallMatchDetails',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('match_starting_date', models.DateField(blank=True, db_index=True, null=True)),
                ('match_finishing_date', models.DateField(blank=True, null=True)),
                ('match_starting_time', models.TimeField(blank=True, null=True)),
                ('match_finishing_time', models.TimeField(blank=True, null=True)),
                ('match_status', models.CharField(choices=[('UPCOMING', 'MATCH_STATUS'), ('STARTED', 'STARTED'), ('FINISHED', 'FINISHED'), ('POSTPONED', 'POSTPONED'), ('DELAYED', 'DELAYED'), ('DRAW', 'DRAW')], db_index=True, max_length=200)),
                ('match_status_text', models.CharField(blank=True, max_length=200, null=True)),
                ('match_facts', models.TextField(blank=True, null=True)),
                ('match_description', models.TextField(blank=True, null=True)),
                ('venue', models.TextField()),
                ('postponed_date', models.DateField(blank=True, null=True)),
                ('postponed_time', models.TimeField(blank=True, null=True)),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], max_length=200)),
                ('team_one_score', models.IntegerField(default=0)),
                ('team_two_score', models.IntegerField(default=0)),
                ('should_show_on_home_page', models.BooleanField(default=False)),
                ('identifier', models.CharField(blank=True, max_length=100, null=True)),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='GuestNews',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('news_date', models.DateField(db_index=True)),
                ('content', models.TextField()),
                ('source', models.CharField(max_length=200)),
                ('title', models.TextField()),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], max_length=200)),
                ('number_of_likes', models.IntegerField(default=0)),
                ('number_of_dislikes', models.IntegerField(default=0)),
                ('display_order', models.IntegerField(default=0)),
                ('is_admin_approved', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='MatchPlayer',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=200)),
                ('jersey_number', models.IntegerField(blank=True, null=True)),
                ('player_role', models.CharField(choices=[('CAPTAIN', 'CAPTAIN'), ('VICE_CAPTAIN', 'VICE_CAPTION'), ('GOAL_KEEPER', 'GOAL_KEEPER'), ('NORMAL', 'NORMAL')], default='NORMAL', max_length=200)),
                ('position', models.CharField(blank=True, max_length=200, null=True)),
                ('order', models.IntegerField(default=0)),
                ('match', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='players', to='api.FootBallMatchDetails')),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='MatchSeries',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('display_name', models.CharField(max_length=200)),
                ('identifier', models.CharField(max_length=200, unique=True)),
                ('country', models.CharField(blank=True, max_length=200, null=True)),
                ('starting_date', models.DateField(blank=True, null=True)),
                ('ending_date', models.DateField(blank=True, null=True)),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], db_index=True, max_length=200)),
            ],
            options={
                'ordering': ('display_name',),
            },
        ),
        migrations.CreateModel(
            name='News',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('news_date', models.DateField(db_index=True)),
                ('content', models.TextField()),
                ('source', models.CharField(max_length=200)),
                ('title', models.TextField()),
                ('news_tags', models.TextField(blank=True, null=True)),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], max_length=200)),
                ('is_trending', models.BooleanField(default=False)),
                ('trend_scale', models.IntegerField(default=0)),
                ('number_of_likes', models.IntegerField(default=0)),
                ('number_of_dislikes', models.IntegerField(default=0)),
                ('number_of_views', models.IntegerField(default=0)),
                ('display_order', models.IntegerField(default=0)),
                ('image', models.ImageField(blank=True, null=True, upload_to=api.models.get_news_image_path)),
                ('identifier', models.IntegerField(blank=True, null=True, unique=True)),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='NewsRelationsShip',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('relation_index', models.IntegerField(default=0)),
                ('common_tags', models.TextField(default='[]')),
                ('news', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.News')),
                ('related_news', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.News')),
            ],
        ),
        migrations.CreateModel(
            name='NewsTag',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('tag_name', models.CharField(max_length=200, unique=True)),
            ],
            options={
                'ordering': ('tag_name',),
            },
        ),
        migrations.CreateModel(
            name='Player',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=200)),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], db_index=True, max_length=200)),
                ('biography', models.TextField()),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='SportsMatch',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('match_starting_date', models.DateField(db_index=True)),
                ('match_starting_time', models.TimeField()),
                ('match_finishing_date', models.DateField()),
                ('match_finishing_time', models.TimeField()),
                ('status', models.CharField(choices=[('UPCOMING', 'MATCH_STATUS'), ('STARTED', 'STARTED'), ('FINISHED', 'FINISHED'), ('POSTPONED', 'POSTPONED'), ('DELAYED', 'DELAYED'), ('DRAW', 'DRAW')], db_index=True, max_length=200)),
                ('match_facts', models.TextField(null=True)),
                ('match_description', models.TextField()),
                ('venue', models.TextField()),
                ('postponed_date', models.DateField()),
                ('postponed_time', models.TimeField()),
                ('concise_summary_text', models.TextField()),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], db_index=True, max_length=200)),
            ],
            options={
                'ordering': ('created_at',),
            },
        ),
        migrations.CreateModel(
            name='SportsTeam',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(default=django.utils.timezone.now)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('display_name', models.CharField(max_length=200)),
                ('description', models.TextField(blank=True, null=True)),
                ('sport', models.CharField(choices=[('FOOTBALL', 'FOOTBALL')], db_index=True, max_length=200)),
                ('team_identifier', models.CharField(max_length=200)),
            ],
            options={
                'ordering': ('display_name',),
            },
        ),
        migrations.AddField(
            model_name='sportsmatch',
            name='team_one',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='sportsmatch',
            name='team_two',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='sportsmatch',
            name='team_won',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='news',
            name='related_news',
            field=models.ManyToManyField(blank=True, related_name='_news_related_news_+', through='api.NewsRelationsShip', to='api.News'),
        ),
        migrations.AddField(
            model_name='news',
            name='related_tags',
            field=models.ManyToManyField(blank=True, related_name='_news_related_tags_+', to='api.NewsTag'),
        ),
        migrations.AddField(
            model_name='footballmatchdetails',
            name='match_series',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='matches', to='api.MatchSeries'),
        ),
        migrations.AddField(
            model_name='footballmatchdetails',
            name='team_one',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='footballmatchdetails',
            name='team_two',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='footballmatchdetails',
            name='team_won',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='+', to='api.SportsTeam'),
        ),
        migrations.AddField(
            model_name='footballmatchcommentary',
            name='football_match',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='commentaries', to='api.FootBallMatchDetails'),
        ),
        migrations.AlterUniqueTogether(
            name='newsrelationsship',
            unique_together=set([('news', 'related_news')]),
        ),
    ]
Beispiel #5
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('rut', models.CharField(max_length=15, unique=True)),
                ('nombre', models.CharField(max_length=30)),
                ('apellido', models.CharField(max_length=30)),
                ('is_active', models.BooleanField(default=True)),
                ('is_staff', models.BooleanField(default=False)),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'abstract': False,
            },
            managers=[
                ('objects', api.models.UserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Camion',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('patente_camion', models.CharField(max_length=20,
                                                    unique=True)),
                ('marca_camion', models.CharField(max_length=20)),
                ('modelo_camion', models.CharField(max_length=20)),
                ('capacidad_camion', models.CharField(max_length=20)),
                ('unidad_medida',
                 models.CharField(choices=[('m3', 'm3'), ('ton', 'ton')],
                                  max_length=5)),
                ('nombre_conductor_principal',
                 models.CharField(max_length=50)),
                ('apellido_conductor_principal',
                 models.CharField(max_length=50)),
                ('telefono_conductor_principal',
                 models.CharField(max_length=20)),
                ('descripcion', models.CharField(blank=True, max_length=20)),
                ('numero_ejes', models.CharField(blank=True, max_length=20)),
                ('color_camion', models.CharField(blank=True, max_length=20)),
                ('foto_camion',
                 models.FileField(
                     blank=True,
                     null=True,
                     upload_to=api.models.get_upload_path_camion)),
                ('available', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Camiones',
            },
        ),
        migrations.CreateModel(
            name='Destino',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_destino', models.CharField(max_length=100)),
                ('nombre_propietario', models.CharField(max_length=100)),
                ('rut_propietario', models.CharField(max_length=20)),
                ('comuna', models.CharField(blank=True, max_length=50)),
                ('calle', models.CharField(blank=True, max_length=50)),
                ('numero', models.IntegerField(blank=True, null=True)),
                ('longitud', models.CharField(max_length=20)),
                ('latitud', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Origen',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_origen', models.CharField(max_length=100)),
                ('comuna', models.CharField(blank=True, max_length=50)),
                ('calle', models.CharField(blank=True, max_length=50)),
                ('numero', models.IntegerField(blank=True, null=True)),
                ('latitud', models.CharField(max_length=20)),
                ('longitud', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
            ],
            options={
                'verbose_name_plural': 'Origenes',
            },
        ),
        migrations.CreateModel(
            name='Proyecto',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('centro_de_coste', models.CharField(max_length=20,
                                                     unique=True)),
                ('nombre_proyecto', models.CharField(max_length=100)),
                ('ubicacion', models.CharField(max_length=100)),
                ('cliente', models.CharField(max_length=100)),
                ('rut_cliente', models.CharField(max_length=20)),
                ('mandante', models.CharField(max_length=100)),
                ('rut_mandante', models.CharField(max_length=20)),
                ('mandante_final', models.CharField(max_length=100)),
                ('cantidad_voucher_imprimir',
                 models.IntegerField(blank=True, default=1)),
                ('available', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Despachador',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('telefono', models.CharField(blank=True, max_length=30)),
                ('origen_asignado', models.IntegerField(blank=True,
                                                        null=True)),
                ('proyecto',
                 models.ForeignKey(blank=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Proyecto')),
            ],
            options={
                'verbose_name_plural': 'Despachadores',
            },
            bases=('api.user', models.Model),
            managers=[
                ('objects', api.models.DespManager()),
            ],
        ),
        migrations.CreateModel(
            name='Suborigen',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('nombre_suborigen', models.CharField(max_length=100)),
                ('activo', models.BooleanField(default=True)),
                ('origen',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Origen')),
            ],
            options={
                'verbose_name_plural': 'Sub-Origenes',
            },
        ),
        migrations.CreateModel(
            name='Subcontratista',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('rut', models.CharField(max_length=20, unique=True)),
                ('razon_social', models.CharField(max_length=100)),
                ('nombre_subcontratista', models.CharField(max_length=100)),
                ('nombre_contacto', models.CharField(max_length=50)),
                ('apellido_contacto', models.CharField(max_length=50)),
                ('email_contacto',
                 models.CharField(blank=True, default='', max_length=100)),
                ('telefono_contacto', models.CharField(max_length=20)),
                ('available', models.BooleanField(default=True)),
                ('proyecto',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Proyecto')),
            ],
        ),
        migrations.AddField(
            model_name='origen',
            name='proyecto',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Proyecto'),
        ),
        migrations.CreateModel(
            name='Material',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('material', models.CharField(max_length=100)),
                ('available', models.BooleanField(default=True)),
                ('destino',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Destino')),
            ],
            options={
                'verbose_name_plural': 'Materiales',
            },
        ),
        migrations.AddField(
            model_name='destino',
            name='proyecto',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Proyecto'),
        ),
        migrations.CreateModel(
            name='CodigoQR',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('activo', models.BooleanField(default=True)),
                ('camion',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Camion')),
            ],
            options={
                'verbose_name_plural': 'Codigos QR',
            },
        ),
        migrations.AddField(
            model_name='camion',
            name='subcontratista',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Subcontratista'),
        ),
        migrations.CreateModel(
            name='Voucher',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('proyecto', models.CharField(max_length=100)),
                ('nombre_cliente', models.CharField(max_length=100)),
                ('rut_cliente', models.CharField(max_length=20)),
                ('nombre_subcontratista', models.CharField(max_length=100)),
                ('rut_subcontratista', models.CharField(max_length=20)),
                ('nombre_conductor_principal',
                 models.CharField(max_length=50)),
                ('apellido_conductor_principal',
                 models.CharField(max_length=50)),
                ('fecha_servidor', models.DateField(auto_now_add=True)),
                ('hora_servidor', models.TimeField(auto_now_add=True)),
                ('fecha', models.DateField()),
                ('hora', models.TimeField()),
                ('patente', models.CharField(max_length=20)),
                ('foto_patente',
                 models.FileField(
                     upload_to=api.models.get_upload_path_patente)),
                ('volumen', models.CharField(max_length=20)),
                ('tipo_material', models.CharField(max_length=50)),
                ('punto_origen', models.CharField(max_length=100)),
                ('punto_suborigen', models.CharField(blank=True,
                                                     max_length=100)),
                ('punto_destino', models.CharField(max_length=100)),
                ('contador_impresiones', models.IntegerField()),
                ('id_qr', models.CharField(blank=True, max_length=255)),
                ('despachador',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Despachador')),
            ],
        ),
        migrations.CreateModel(
            name='OrigenTemporal',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('id_origen', models.IntegerField()),
                ('timestamp_inicio',
                 models.DateTimeField(default=django.utils.timezone.now)),
                ('duracion', models.IntegerField(default=12)),
                ('activo', models.BooleanField(default=True)),
                ('despachador',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Despachador')),
            ],
            options={
                'verbose_name_plural': 'Origenes',
            },
        ),
        migrations.CreateModel(
            name='Administrador',
            fields=[
                ('user_ptr',
                 models.OneToOneField(
                     auto_created=True,
                     on_delete=django.db.models.deletion.CASCADE,
                     parent_link=True,
                     primary_key=True,
                     serialize=False,
                     to=settings.AUTH_USER_MODEL)),
                ('email', models.CharField(max_length=100, unique=True)),
                ('cargo', models.CharField(blank=True, max_length=100)),
                ('proyecto',
                 models.ManyToManyField(blank=True,
                                        related_name='proyecto',
                                        to='api.Proyecto')),
            ],
            options={
                'verbose_name_plural': 'Administradores',
            },
            bases=('api.user', models.Model),
            managers=[
                ('objects', api.models.AdminManager()),
            ],
        ),
    ]
Beispiel #6
0
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('password', models.CharField(max_length=128, verbose_name='password')),
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('is_superuser', models.BooleanField(default=False, help_text='Designates that this user has all permissions without explicitly assigning them.', verbose_name='superuser status')),
                ('first_name', models.CharField(blank=True, max_length=30, verbose_name='first name')),
                ('last_name', models.CharField(blank=True, max_length=150, verbose_name='last name')),
                ('is_staff', models.BooleanField(default=False, help_text='Designates whether the user can log into this admin site.', verbose_name='staff status')),
                ('is_active', models.BooleanField(default=True, help_text='Designates whether this user should be treated as active. Unselect this instead of deleting accounts.', verbose_name='active')),
                ('date_joined', models.DateTimeField(default=django.utils.timezone.now, verbose_name='date joined')),
                ('email', models.EmailField(max_length=254, unique=True, verbose_name='email address')),
                ('phone', models.CharField(blank=True, max_length=17, validators=[django.core.validators.RegexValidator(message="Phone number must be entered in the format: '+999999999'. Up to 15 digits allowed.", regex='^\\+?1?\\d{9,15}$')])),
                ('groups', models.ManyToManyField(blank=True, help_text='The groups this user belongs to. A user will get all permissions granted to each of their groups.', related_name='user_set', related_query_name='user', to='auth.Group', verbose_name='groups')),
                ('user_permissions', models.ManyToManyField(blank=True, help_text='Specific permissions for this user.', related_name='user_set', related_query_name='user', to='auth.Permission', verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='DayProbability',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day_of_week', models.CharField(choices=[('Sun', 'Sunday'), ('Mon', 'Monday'), ('Tue', 'Tuesday'), ('Wed', 'Wednesday'), ('Thu', 'Thursday'), ('Fri', 'Friday'), ('Sat', 'Saturday')], max_length=10)),
                ('probability', djongo.models.fields.ArrayField(model_container=api.models.Probability)),
            ],
        ),
        migrations.CreateModel(
            name='Garage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('start_enforce_time', models.TimeField()),
                ('end_enforce_time', models.TimeField()),
                ('enforced_on_weekends', models.BooleanField(default=False)),
                ('probability', djongo.models.fields.ArrayField(model_container=api.models.DayProbability)),
                ('latitude', models.FloatField()),
                ('longitude', models.FloatField()),
            ],
        ),
        migrations.CreateModel(
            name='Probability',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('time', models.TimeField()),
                ('probability', models.FloatField(validators=[django.core.validators.MinValueValidator(0.0), django.core.validators.MaxValueValidator(1.0)])),
            ],
        ),
        migrations.CreateModel(
            name='Ticket',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('date', models.DateTimeField()),
            ],
        ),
        migrations.CreateModel(
            name='PasswordResetToken',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('token', models.CharField(max_length=6)),
                ('expires', models.DateTimeField()),
                ('attempts', models.IntegerField(default=3)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Park',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('start', models.DateTimeField()),
                ('end', models.DateTimeField(default=None)),
                ('ticket', djongo.models.fields.EmbeddedField(blank=True, default=None, model_container=api.models.Ticket, null=True)),
                ('garage', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='api.Garage')),
                ('user', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Patient',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
            options={
                'verbose_name': 'Patient',
                'verbose_name_plural': 'Patients',
            },
        ),
        migrations.CreateModel(
            name='Procedure',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=100, unique=True)),
            ],
            options={
                'verbose_name': 'Procedure',
                'verbose_name_plural': 'Procedures',
            },
        ),
        migrations.CreateModel(
            name='Scheduling',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('date',
                 models.DateField(default=django.utils.timezone.now,
                                  validators=[api.models.validate_date])),
                ('initial_time',
                 models.TimeField(default=django.utils.timezone.now)),
                ('final_time',
                 models.TimeField(default=django.utils.timezone.now)),
                ('patient',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Patient')),
                ('procedure',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.Procedure')),
            ],
            options={
                'verbose_name': 'Scheduling',
                'verbose_name_plural': 'Schedules',
                'ordering': ['date'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='scheduling',
            unique_together={('date', 'procedure', 'patient')},
        ),
    ]
Beispiel #8
0
class Migration(migrations.Migration):

    initial = True

    dependencies = []

    operations = [
        migrations.CreateModel(
            name='Address',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('latitude', models.FloatField(blank=True, null=True)),
                ('longitude', models.FloatField(blank=True, null=True)),
                ('pincode', models.CharField(max_length=9)),
                ('extra',
                 models.CharField(blank=True, max_length=100, null=True)),
            ],
            options={
                'db_table': 'address',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Appointment',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('create_on',
                 models.DateTimeField(default=api.models.current_timestamp)),
                ('date', models.DateField()),
                ('time', models.TimeField()),
            ],
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=60)),
                ('code', models.IntegerField(unique=True)),
            ],
            options={
                'db_table': 'cities',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Clinician',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('work_timings',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=django.contrib.postgres.fields.ArrayField(
                         base_field=models.TimeField(), size=2),
                     size=7)),
                ('break_timings',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=django.contrib.postgres.fields.ArrayField(
                         base_field=models.TimeField(), size=2),
                     size=7)),
                ('vacations',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=django.contrib.postgres.fields.ArrayField(
                         base_field=models.DateField(), size=2),
                     size=None)),
                ('education', models.TextField()),
                ('experience',
                 django.contrib.postgres.fields.ArrayField(
                     base_field=models.TextField(), size=None)),
            ],
            options={
                'db_table': 'clinicians',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('code', models.IntegerField(unique=True)),
            ],
            options={
                'db_table': 'countries',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Coupon',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('name', models.CharField(max_length=30)),
                ('quantity', models.PositiveSmallIntegerField()),
                ('validty', models.BooleanField(default=True)),
                ('expiry', models.DateField()),
                ('date_added',
                 models.DateTimeField(default=api.models.current_timestamp,
                                      editable=False)),
            ],
            options={
                'db_table': 'coupons',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='DiscountCard',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('code', models.CharField(max_length=3)),
                ('name', models.CharField(max_length=40, unique=True)),
                ('description', models.TextField(blank=True, null=True)),
                ('quantity', models.PositiveSmallIntegerField(default=0)),
                ('price', models.PositiveSmallIntegerField(default=0)),
                ('validity', models.DateField()),
            ],
            options={
                'db_table': 'discountcards',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=60)),
                ('code', models.IntegerField(unique=True)),
                ('city',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.City')),
            ],
            options={
                'db_table': 'districts',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='HealthCheckup',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=40, unique=True)),
                ('description', models.TextField()),
                ('price', models.PositiveSmallIntegerField(default=0)),
                ('image', models.ImageField(upload_to='health_checks')),
            ],
            options={
                'db_table': 'healthchecks',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Provider',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('is_branch', models.BooleanField(default=False)),
                ('active_from', models.DateField()),
                ('address',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Address')),
                ('clinicians', models.ManyToManyField(to='api.Clinician')),
                ('parent_provider',
                 models.OneToOneField(
                     blank=True,
                     null=True,
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Provider')),
            ],
            options={
                'db_table': 'providers',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Question',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('question', models.CharField(max_length=100)),
            ],
            options={
                'db_table': 'questions',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Reseller',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
            ],
            options={
                'db_table': 'resellers',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='SalesAgent',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('resellers', models.ManyToManyField(to='api.Reseller')),
            ],
            options={
                'db_table': 'salesagents',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Seeker',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('profession',
                 models.CharField(choices=[('doctor', 'doctor'),
                                           ('teacher', 'teacher'),
                                           ('engineer', 'engineer'),
                                           ('professor', 'professor'),
                                           ('business', 'business'),
                                           ('other', 'other')],
                                  max_length=100)),
                ('language',
                 models.CharField(choices=[('english', 'english'),
                                           ('hindi', 'hindi'),
                                           ('telugu', 'telugu'),
                                           ('marathi', 'marathi'),
                                           ('malayalam', 'malayalam'),
                                           ('gujarati', 'gujarati'),
                                           ('bhojpuri', 'bhojpuri'),
                                           ('tamil', 'tamil'),
                                           ('other', 'other')],
                                  max_length=100)),
                ('dob', models.DateField()),
                ('profile_pic',
                 models.ImageField(default='default_profile.jpg',
                                   upload_to='profile_pics')),
                ('family',
                 models.ManyToManyField(related_name='_seeker_family_+',
                                        to='api.Seeker')),
            ],
            options={
                'db_table': 'seekers',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Speciality',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField()),
            ],
            options={
                'db_table': 'specialities',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Sponsor',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('org_name', models.CharField(max_length=50)),
                ('org_size', models.PositiveSmallIntegerField(default=10)),
            ],
            options={
                'db_table': 'sponsors',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='State',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=60)),
                ('code', models.IntegerField(unique=True)),
                ('country',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Country')),
            ],
            options={
                'db_table': 'states',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Test',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('code', models.CharField(max_length=10)),
                ('department', models.CharField(max_length=70)),
                ('description', models.TextField()),
            ],
            options={
                'db_table': 'tests',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='TestCategory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('description', models.TextField()),
            ],
            options={
                'db_table': 'test_categories',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Testimonial',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('text', models.TextField()),
                ('date_added',
                 models.DateTimeField(default=api.models.current_timestamp)),
                ('user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Seeker')),
            ],
            options={
                'db_table': 'testimonials',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='TestSubcategory',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('name', models.CharField(max_length=40)),
                ('description', models.TextField()),
                ('category',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.TestCategory')),
            ],
            options={
                'db_table': 'test_subcategories',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='Transaction',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('uid', models.UUIDField(default=uuid.uuid4, editable=False)),
                ('IP', models.GenericIPAddressField(editable=False)),
                ('timestamp',
                 models.DateTimeField(default=api.models.current_timestamp,
                                      editable=False)),
                ('amount', models.PositiveSmallIntegerField(default=0)),
                ('status',
                 models.CharField(choices=[('1', 'Paid to Pheatlh'),
                                           ('2', 'Paid to user'),
                                           ('3', 'Pending'), ('4', 'Failed')],
                                  max_length=1)),
            ],
            options={
                'db_table': 'transactions',
                'managed': True,
            },
        ),
        migrations.CreateModel(
            name='User',
            fields=[
                ('id', models.AutoField(primary_key=True, serialize=False)),
                ('status', models.NullBooleanField(default=True,
                                                   editable=False)),
                ('role',
                 models.CharField(choices=[('healthprovider',
                                            'healthprovider'),
                                           ('healthseeker', 'healthseeker'),
                                           ('clinician', 'clinician'),
                                           ('sponsor', 'sponsor'),
                                           ('salesagent', 'salesagent'),
                                           ('reseller', 'reseller'),
                                           ('admin', 'admin')],
                                  editable=False,
                                  max_length=30)),
                ('reg_date',
                 models.DateTimeField(default=api.models.current_timestamp,
                                      editable=False)),
                ('last_update', models.DateTimeField(editable=False)),
                ('last_IP', models.GenericIPAddressField(editable=False)),
                ('email', models.EmailField(max_length=254)),
                ('name', models.CharField(max_length=150)),
                ('mobile',
                 models.CharField(max_length=15,
                                  validators=[
                                      django.core.validators.RegexValidator(
                                          message='Invalid Number',
                                          regex='^(\\+\\d{1,3}[- ]?)?\\d{10}$')
                                  ])),
                ('password', models.CharField(max_length=100)),
                ('gender',
                 models.CharField(choices=[('M', 'Male'), ('F', 'Female'),
                                           ('O', 'Other')],
                                  max_length=1)),
                ('answer', models.CharField(max_length=100)),
                ('question',
                 models.ForeignKey(
                     on_delete=django.db.models.deletion.DO_NOTHING,
                     to='api.Question')),
            ],
            options={
                'db_table': 'users',
                'managed': True,
            },
        ),
        migrations.AddField(
            model_name='transaction',
            name='receiver',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name='received',
                to='api.User'),
        ),
        migrations.AddField(
            model_name='transaction',
            name='sender',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING,
                related_name='issued',
                to='api.User'),
        ),
        migrations.AddField(
            model_name='test',
            name='subcategory',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.TestSubcategory'),
        ),
        migrations.AddField(
            model_name='sponsor',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='seeker',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='salesagent',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='reseller',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='provider',
            name='poc',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='provider',
            name='specialities',
            field=models.ManyToManyField(to='api.Speciality'),
        ),
        migrations.AddField(
            model_name='healthcheckup',
            name='tests',
            field=models.ManyToManyField(to='api.Test'),
        ),
        migrations.AddField(
            model_name='discountcard',
            name='health_checkups',
            field=models.ManyToManyField(to='api.HealthCheckup'),
        ),
        migrations.AddField(
            model_name='clinician',
            name='specialities',
            field=models.ManyToManyField(to='api.Speciality'),
        ),
        migrations.AddField(
            model_name='clinician',
            name='user',
            field=models.OneToOneField(
                on_delete=django.db.models.deletion.DO_NOTHING, to='api.User'),
        ),
        migrations.AddField(
            model_name='city',
            name='state',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.State'),
        ),
        migrations.AddField(
            model_name='appointment',
            name='provider',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.Provider'),
        ),
        migrations.AddField(
            model_name='appointment',
            name='under',
            field=models.OneToOneField(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.Clinician'),
        ),
        migrations.AddField(
            model_name='address',
            name='district',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.DO_NOTHING,
                to='api.District'),
        ),
    ]
class Migration(migrations.Migration):

    dependencies = [
        ('api', '0003_auto_20201205_1610'),
    ]

    operations = [
        migrations.CreateModel(
            name='Event',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('title',
                 models.CharField(blank=True, default='', max_length=100)),
                ('description', models.TextField(blank=True)),
                ('year',
                 models.PositiveIntegerField(
                     choices=[(1984, 1984), (1985, 1985), (1986, 1986),
                              (1987, 1987), (1988, 1988), (1989, 1989),
                              (1990, 1990), (1991, 1991), (1992, 1992),
                              (1993, 1993), (1994, 1994), (1995, 1995),
                              (1996, 1996), (1997, 1997), (1998, 1998),
                              (1999, 1999), (2000, 2000), (2001, 2001),
                              (2002, 2002), (2003, 2003), (2004, 2004),
                              (2005, 2005), (2006, 2006), (2007, 2007),
                              (2008, 2008), (2009, 2009), (2010, 2010),
                              (2011, 2011), (2012, 2012), (2013, 2013),
                              (2014, 2014), (2015, 2015), (2016, 2016),
                              (2017, 2017), (2018, 2018), (2019, 2019),
                              (2020, 2020), (2021, 2021), (2022, 2022),
                              (2023, 2023)],
                     default=2020,
                     validators=[
                         django.core.validators.MinValueValidator(1984),
                         api.models.max_value_current_year
                     ])),
                ('month',
                 models.PositiveIntegerField(
                     choices=[(1, 'January'), (2, 'February'), (3, 'March'),
                              (4, 'April'), (5, 'May'), (6, 'June'),
                              (7, 'July'), (8, 'August'), (9, 'September'),
                              (10, 'October'), (11, 'November'),
                              (12, 'December')],
                     validators=[
                         django.core.validators.MinValueValidator(1),
                         django.core.validators.MaxValueValidator(12)
                     ])),
                ('day',
                 models.PositiveIntegerField(validators=[
                     django.core.validators.MinValueValidator(1),
                     django.core.validators.MaxValueValidator(31)
                 ])),
                ('start_time', models.TimeField(blank=True)),
                ('end_time', models.TimeField(blank=True)),
                ('slug', models.SlugField(editable=False, max_length=100)),
                ('department',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='events',
                                   to='api.department')),
                ('faculty',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   related_name='events',
                                   to='api.faculty')),
            ],
        ),
        migrations.RemoveField(
            model_name='facultyevent',
            name='department',
        ),
        migrations.RemoveField(
            model_name='facultyevent',
            name='faculty',
        ),
        migrations.DeleteModel(name='UniversityEvent', ),
        migrations.DeleteModel(name='FacultyEvent', ),
    ]
class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('auth', '0011_update_proxy_permissions'),
    ]

    operations = [
        migrations.CreateModel(
            name='User',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('password',
                 models.CharField(max_length=128, verbose_name='password')),
                ('last_login',
                 models.DateTimeField(blank=True,
                                      null=True,
                                      verbose_name='last login')),
                ('is_superuser',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates that this user has all permissions without explicitly assigning them.',
                     verbose_name='superuser status')),
                ('username',
                 models.CharField(
                     error_messages={
                         'unique': 'A user with that username already exists.'
                     },
                     help_text=
                     'Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only.',
                     max_length=150,
                     unique=True,
                     validators=[
                         django.contrib.auth.validators.
                         UnicodeUsernameValidator()
                     ],
                     verbose_name='username')),
                ('first_name',
                 models.CharField(blank=True,
                                  max_length=30,
                                  verbose_name='first name')),
                ('last_name',
                 models.CharField(blank=True,
                                  max_length=150,
                                  verbose_name='last name')),
                ('email',
                 models.EmailField(blank=True,
                                   max_length=254,
                                   verbose_name='email address')),
                ('is_staff',
                 models.BooleanField(
                     default=False,
                     help_text=
                     'Designates whether the user can log into this admin site.',
                     verbose_name='staff status')),
                ('is_active',
                 models.BooleanField(
                     default=True,
                     help_text=
                     'Designates whether this user should be treated as active. Unselect this instead of deleting accounts.',
                     verbose_name='active')),
                ('date_joined',
                 models.DateTimeField(default=django.utils.timezone.now,
                                      verbose_name='date joined')),
                ('type_of_user',
                 models.CharField(choices=[('customer', 'Customer Care'),
                                           ('ado', 'ADO Officer'),
                                           ('dda', 'DDA Officer'),
                                           ('admin', 'Super Admin')],
                                  max_length=20)),
                ('groups',
                 models.ManyToManyField(
                     blank=True,
                     help_text=
                     'The groups this user belongs to. A user will get all permissions granted to each of their groups.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Group',
                     verbose_name='groups')),
                ('user_permissions',
                 models.ManyToManyField(
                     blank=True,
                     help_text='Specific permissions for this user.',
                     related_name='user_set',
                     related_query_name='user',
                     to='auth.Permission',
                     verbose_name='user permissions')),
            ],
            options={
                'verbose_name': 'user',
                'verbose_name_plural': 'users',
                'abstract': False,
            },
            managers=[
                ('objects', api.models.CustomUserManager()),
            ],
        ),
        migrations.CreateModel(
            name='Ado',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=200,
                                          null=True)),
                ('number',
                 models.CharField(blank=True, max_length=15, null=True)),
                ('email',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('auth_user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='AdoReport',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('village_code',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('farmer_code',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('farmer_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('father_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('longitude',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('latitude',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('kila_num',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('murrabba_num',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('incident_reason',
                 models.CharField(blank=True, max_length=500, null=True)),
                ('remarks',
                 models.CharField(blank=True, max_length=500, null=True)),
                ('amount',
                 models.CharField(blank=True, max_length=500, null=True)),
                ('ownership',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('action',
                 models.CharField(blank=True,
                                  choices=[('chalaan', 'Challan'),
                                           ('FIR', 'FIR')],
                                  default='FIR',
                                  max_length=50,
                                  null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Dda',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(blank=True,
                                          max_length=200,
                                          null=True)),
                ('number',
                 models.CharField(blank=True, max_length=15, null=True)),
                ('email',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('auth_user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='District',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('district',
                 models.CharField(blank=True, max_length=500, null=True)),
                ('district_code',
                 models.CharField(blank=True, max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Village',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('village',
                 models.CharField(blank=True, max_length=500, null=True)),
                ('village_code',
                 models.CharField(blank=True, max_length=200, null=True)),
            ],
        ),
        migrations.CreateModel(
            name='Location',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('state', models.CharField(max_length=50)),
                ('district', models.CharField(max_length=50)),
                ('block_name',
                 models.CharField(blank=True, max_length=50, null=True)),
                ('village_name',
                 models.CharField(blank=True, max_length=100, null=True)),
                ('longitude', models.CharField(max_length=100)),
                ('latitude', models.CharField(max_length=100)),
                ('acq_date',
                 models.DateField(default=django.utils.timezone.now)),
                ('acq_time',
                 models.TimeField(default=django.utils.timezone.now)),
                ('status',
                 models.CharField(choices=[('pending', 'pending'),
                                           ('ongoing', 'ongoing'),
                                           ('completed', 'completed')],
                                  default='pending',
                                  max_length=10)),
                ('ado',
                 models.ForeignKey(blank=True,
                                   default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='location_ado',
                                   to='api.Ado')),
                ('dda',
                 models.ForeignKey(blank=True,
                                   default=None,
                                   null=True,
                                   on_delete=django.db.models.deletion.CASCADE,
                                   related_name='location_dda',
                                   to='api.Dda')),
            ],
        ),
        migrations.CreateModel(
            name='Image',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('image', models.ImageField(upload_to='images/')),
                ('report',
                 models.ForeignKey(on_delete=django.db.models.deletion.CASCADE,
                                   to='api.AdoReport')),
            ],
        ),
        migrations.AddField(
            model_name='dda',
            name='district',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='dda_district',
                to='api.District'),
        ),
        migrations.AddField(
            model_name='adoreport',
            name='location',
            field=models.ForeignKey(
                on_delete=django.db.models.deletion.CASCADE,
                to='api.Location'),
        ),
        migrations.AddField(
            model_name='adoreport',
            name='village',
            field=models.ForeignKey(
                blank=True,
                default=None,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='location_village',
                to='api.Village'),
        ),
        migrations.AddField(
            model_name='ado',
            name='dda',
            field=models.ForeignKey(
                blank=True,
                null=True,
                on_delete=django.db.models.deletion.CASCADE,
                related_name='ado_dda',
                to='api.Dda'),
        ),
        migrations.AddField(
            model_name='ado',
            name='village',
            field=models.ManyToManyField(blank=True,
                                         related_name='ado_village',
                                         to='api.Village'),
        ),
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('id',
                 models.AutoField(auto_created=True,
                                  primary_key=True,
                                  serialize=False,
                                  verbose_name='ID')),
                ('name', models.CharField(max_length=200, null=True)),
                ('auth_user',
                 models.OneToOneField(
                     on_delete=django.db.models.deletion.CASCADE,
                     to=settings.AUTH_USER_MODEL)),
            ],
        ),
    ]