# Generated by Django 2.2.13 on 2020-11-17 19:30

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Currency',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('code', models.CharField(max_length=3, unique=True)),
                ('symbol', models.CharField(blank=True, max_length=5)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
            ],
            options={
                'verbose_name': 'Currency',
                'verbose_name_plural': 'Currencies',
            },
        ),
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=512)),
                ('iso2_code', models.CharField(max_length=2, unique=True)),
                ('iso3_code', models.CharField(max_length=3, unique=True)),
                ('phone_code', models.CharField(blank=True, max_length=20)),
                ('population', models.CharField(blank=True, max_length=15)),
                ('area_km2', models.CharField(blank=True, max_length=15)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('currency', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='countries', to='main.Currency')),
            ],
            options={
                'verbose_name': 'Country',
                'verbose_name_plural': 'Countries',
            },
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=512)),
                ('time_zone_utc', models.CharField(blank=True, max_length=25)),
                ('density_by_km2', models.FloatField(blank=True, validators=[main.validators.validate_decimals_3])),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='cities', to='main.Country')),
            ],
            options={
                'verbose_name': 'Cities',
                'verbose_name_plural': 'Cities',
            },
        ),
    ]
