# Generated by Django 3.1.7 on 2021-05-14 08:36

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Organisation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('domain_name', models.CharField(max_length=253)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationRegion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('auth_token', models.CharField(max_length=100)),
                ('is_verified', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('user_organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisation')),
            ],
            options={
                'unique_together': {('user_info', 'user_organisation')},
            },
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisationregion'),
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisationtype'),
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_users_info',
            field=models.ManyToManyField(through='users.OrganisationUser', to=settings.AUTH_USER_MODEL),
        ),
    ]

# Generated by Django 3.1.7 on 2021-05-14 08:36

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


class Migration(migrations.Migration):

    initial = True

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

    operations = [
        migrations.CreateModel(
            name='Organisation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('domain_name', models.CharField(max_length=253)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationRegion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationType',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='UserProfile',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('auth_token', models.CharField(max_length=100)),
                ('is_verified', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='OrganisationUser',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('user_info', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
                ('user_organisation', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisation')),
            ],
            options={
                'unique_together': {('user_info', 'user_organisation')},
            },
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_region',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisationregion'),
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.organisationtype'),
        ),
        migrations.AddField(
            model_name='organisation',
            name='organisation_users_info',
            field=models.ManyToManyField(through='users.OrganisationUser', to=settings.AUTH_USER_MODEL),
        ),
    ]

# Generated by Django 3.1.7 on 2021-05-14 08:36