# Generated by Django 5.2.8 on 2025-11-22 05:57

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Country',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('name_ascii', models.CharField(max_length=100, verbose_name='ASCII Name')),
                ('geoname_id', models.IntegerField(unique=True, verbose_name='Geoname ID')),
                ('continent', models.CharField(max_length=50, verbose_name='Continent')),
                ('code2', models.CharField(max_length=2, unique=True, verbose_name='ISO Alpha-2 Code')),
                ('code3', models.CharField(max_length=3, unique=True, verbose_name='ISO Alpha-3 Code')),
                ('calling_code', models.CharField(max_length=10, verbose_name='Calling Code')),
                ('postal_code_format', models.CharField(blank=True, max_length=100, null=True, verbose_name='Postal Code Format')),
                ('postal_code_regex', models.CharField(blank=True, max_length=255, null=True, verbose_name='Postal Code Regex')),
                ('flag', models.ImageField(blank=True, null=True, upload_to='flags/', verbose_name='Flag')),
            ],
            options={
                'verbose_name': 'Country',
                'verbose_name_plural': 'Countries',
            },
        ),
        migrations.CreateModel(
            name='Region',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('name_ascii', models.CharField(max_length=100, verbose_name='ASCII Name')),
                ('geoname_id', models.IntegerField(unique=True, verbose_name='Geoname ID')),
                ('code', models.CharField(max_length=10, verbose_name='Code')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='regions', to='geobank.country', verbose_name='Country')),
            ],
            options={
                'verbose_name': 'Region',
                'verbose_name_plural': 'Regions',
                'unique_together': {('country', 'code')},
            },
        ),
        migrations.CreateModel(
            name='City',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=100, verbose_name='Name')),
                ('name_ascii', models.CharField(max_length=100, verbose_name='ASCII Name')),
                ('geoname_id', models.IntegerField(unique=True, verbose_name='Geoname ID')),
                ('country', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='geobank.country', verbose_name='Country')),
                ('region', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='cities', to='geobank.region', verbose_name='Region')),
            ],
            options={
                'verbose_name': 'City',
                'verbose_name_plural': 'Cities',
            },
        ),
    ]
