# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-07 21:09
from __future__ import unicode_literals

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


def populateRegionModel(apps, schema_editor):
    RegionModel = apps.get_model('auth_manager', 'RegionModel')
    obj = RegionModel(name='DEFAULT')
    obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ('auth_manager', '0006_auto_20171230_2241'),
    ]

    operations = [
        migrations.CreateModel(
            name='RegionModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9A-Z_]*$', 'Only capital Alphanumeric characters and Underscore symbol are allowed')])),
            ],
            options={
                'verbose_name': 'region',
                'verbose_name_plural': 'regions',
                'db_table': 'region',
            },
        ),
        migrations.AlterField(
            model_name='userlocationmodel',
            name='name',
            field=models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9A-Z_]*$', 'Only capital Alphanumeric characters and Underscore symbol are allowed')]),
        ),
        migrations.RunPython(
            populateRegionModel
        ),
        migrations.AddField(
            model_name='userprofilemodel',
            name='region',
            field=models.ForeignKey(default='DEFAULT', on_delete=django.db.models.deletion.PROTECT, to='auth_manager.RegionModel', to_field='name'),
        ),
    ]

# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-01-07 21:09
from __future__ import unicode_literals

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


def populateRegionModel(apps, schema_editor):
    RegionModel = apps.get_model('auth_manager', 'RegionModel')
    obj = RegionModel(name='DEFAULT')
    obj.save()


class Migration(migrations.Migration):

    dependencies = [
        ('auth_manager', '0006_auto_20171230_2241'),
    ]

    operations = [
        migrations.CreateModel(
            name='RegionModel',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9A-Z_]*$', 'Only capital Alphanumeric characters and Underscore symbol are allowed')])),
            ],
            options={
                'verbose_name': 'region',
                'verbose_name_plural': 'regions',
                'db_table': 'region',
            },
        ),
        migrations.AlterField(
            model_name='userlocationmodel',
            name='name',
            field=models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9A-Z_]*$', 'Only capital Alphanumeric characters and Underscore symbol are allowed')]),
        ),
        migrations.RunPython(
            populateRegionModel
        ),
        migrations.AddField(
            model_name='userprofilemodel',
            name='region',
            field=models.ForeignKey(default='DEFAULT', on_delete=django.db.models.deletion.PROTECT, to='auth_manager.RegionModel', to_field='name'),
        ),
    ]

# -*- coding: utf-8 -*- # Generated by Django 1.11.9 on 2018-01-07 21:09