<reponame>habibaudu/Elite<filename>adminapp/migrations/0001_initial.py
# Generated by Django 3.0.6 on 2020-06-07 13:19

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='AdminPermission',
            fields=[
                ('id', models.CharField(default=utils.id_genrator.generate_id, editable=False, max_length=12, primary_key=True, serialize=False)),
                ('state', models.CharField(choices=[('active', 'active'), ('deleted', 'deleted')], default='active', max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('allow_make_superadmin', models.BooleanField(default=False)),
                ('allow_delete_user', models.BooleanField(default=False)),
                ('allow_view_users', models.BooleanField(default=False)),
            ],
            options={
                'ordering': ['-created_at'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='AdminRole',
            fields=[
                ('id', models.CharField(default=utils.id_genrator.generate_id, editable=False, max_length=12, primary_key=True, serialize=False)),
                ('state', models.CharField(choices=[('active', 'active'), ('deleted', 'deleted')], default='active', max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('name', models.CharField(max_length=100)),
                ('role_permission', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='adminapp.AdminPermission')),
            ],
            options={
                'ordering': ['-created_at'],
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='Admin',
            fields=[
                ('last_login', models.DateTimeField(blank=True, null=True, verbose_name='last login')),
                ('id', models.CharField(default=utils.id_genrator.generate_id, editable=False, max_length=12, primary_key=True, serialize=False)),
                ('state', models.CharField(choices=[('active', 'active'), ('deleted', 'deleted')], default='active', max_length=50)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('username', models.CharField(max_length=100, unique=True)),
                ('password', models.CharField(max_length=100)),
                ('email', models.EmailField(max_length=100, null=True, unique=True)),
                ('profile_image', models.URLField(default='https://res.cloudinary.com/profile_image.png')),
                ('role', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='adminapp.AdminRole')),
            ],
            options={
                'abstract': False,
            },
        ),
    ]
