# Generated by Django 3.2.4 on 2021-08-18 08:12

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tg_username', models.CharField(max_length=128, verbose_name='Юзернейм телеграм юзера')),
                ('tg_id', models.CharField(max_length=128, verbose_name='ID телеграм юзера')),
                ('tg_firstname', models.CharField(blank=True, max_length=128, null=True, verbose_name='Имя телеграм юзера')),
                ('tg_lastname', models.CharField(blank=True, max_length=128, null=True, verbose_name='Фамилия телеграм юзера')),
                ('username', models.CharField(blank=True, max_length=200, null=True, unique=True, validators=[django.core.validators.MinLengthValidator(3)], verbose_name='Username')),
                ('is_active', models.BooleanField(default=True, verbose_name='Активен ли пользователь')),
                ('is_admin', models.BooleanField(default=False)),
                ('total_balance', models.IntegerField(blank=True, default=0, null=True, verbose_name='Общий баланс')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
                'db_table': 'Users',
            },
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300, verbose_name='Название компании')),
                ('secondary_key', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True, verbose_name='Вторичный ключ(UUID)')),
                ('payment', models.CharField(choices=[('actual', 'фактический расчет'), ('cumulative', 'накопительный расчет')], default=('actual', 'фактический расчет'), max_length=400, verbose_name='Тип расчета')),
                ('address', models.CharField(default='Bishkek', max_length=400, verbose_name='Адрес компании')),
                ('bonus_activation', models.BooleanField(default=False, verbose_name='Возможность активирования бонуса')),
                ('leave_review', models.BooleanField(default=True, verbose_name='Возможность оставлять отзывы')),
                ('is_active', models.BooleanField(default=True, verbose_name='Активна ли компания')),
            ],
            options={
                'verbose_name': 'Организация',
                'verbose_name_plural': 'Организации',
                'db_table': 'Organization',
            },
        ),
        migrations.CreateModel(
            name='UserToken',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('activated', models.BooleanField(default=False)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='user_token', to='accounts.employee')),
            ],
            options={
                'verbose_name': 'Токен пользователя',
                'verbose_name_plural': 'Токены Пользователей',
                'db_table': 'UserTokens',
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('text_review', models.TextField(max_length=500, verbose_name='текст отзыва')),
                ('user_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='review_name', to='accounts.employee', verbose_name='имя пользователя')),
            ],
            options={
                'verbose_name': 'Отзыв',
                'verbose_name_plural': 'Отзывы',
                'db_table': 'Reviews',
            },
        ),
        migrations.AddField(
            model_name='employee',
            name='organization_id',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='employe_org', to='accounts.organization', verbose_name='Внешний ключ на организацию'),
        ),
        migrations.CreateModel(
            name='BalanceChange',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('accrual', 'Начисление'), ('write-off', 'Списание')], max_length=200, verbose_name='Тип')),
                ('sum_balance', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)], verbose_name='Сумма')),
                ('comment', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Комментарий')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('balance_after_transaction', models.IntegerField(blank=True, null=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bal_em', to='accounts.employee', verbose_name='Пользователь')),
            ],
            options={
                'verbose_name': 'Изменение Баланса',
                'verbose_name_plural': 'Изменение Балансов',
                'db_table': 'BalanceChange',
            },
        ),
    ]

f6493355621ef4bd50f3595c5473f651d5de744d
<mask token>

<mask token>


class Migration(migrations.Migration):
    <mask token>
    <mask token>
    <mask token>

<mask token>


class Migration(migrations.Migration):
    initial = True
    dependencies = []
    operations = [migrations.CreateModel(name='Employee', fields=[('id',
        models.BigAutoField(auto_created=True, primary_key=True, serialize=
        False, verbose_name='ID')), ('tg_username', models.CharField(
        max_length=128, verbose_name='Юзернейм телеграм юзера')), ('tg_id',
        models.CharField(max_length=128, verbose_name='ID телеграм юзера')),
        ('tg_firstname', models.CharField(blank=True, max_length=128, null=
        True, verbose_name='Имя телеграм юзера')), ('tg_lastname', models.
        CharField(blank=True, max_length=128, null=True, verbose_name=
        'Фамилия телеграм юзера')), ('username', models.CharField(blank=
        True, max_length=200, null=True, unique=True, validators=[django.
        core.validators.MinLengthValidator(3)], verbose_name='Username')),
        ('is_active', models.BooleanField(default=True, verbose_name=
        'Активен ли пользователь')), ('is_admin', models.BooleanField(
        default=False)), ('total_balance', models.IntegerField(blank=True,
        default=0, null=True, verbose_name='Общий баланс'))], options={
        'verbose_name': 'Пользователь', 'verbose_name_plural':
        'Пользователи', 'db_table': 'Users'}), migrations.CreateModel(name=
        'Organization', fields=[('id', models.BigAutoField(auto_created=
        True, primary_key=True, serialize=False, verbose_name='ID')), (
        'name', models.CharField(max_length=300, verbose_name=
        'Название компании')), ('secondary_key', models.UUIDField(db_index=
        True, default=uuid.uuid4, editable=False, unique=True, verbose_name
        ='Вторичный ключ(UUID)')), ('payment', models.CharField(choices=[(
        'actual', 'фактический расчет'), ('cumulative',
        'накопительный расчет')], default=('actual', 'фактический расчет'),
        max_length=400, verbose_name='Тип расчета')), ('address', models.
        CharField(default='Bishkek', max_length=400, verbose_name=
        'Адрес компании')), ('bonus_activation', models.BooleanField(
        default=False, verbose_name='Возможность активирования бонуса')), (
        'leave_review', models.BooleanField(default=True, verbose_name=
        'Возможность оставлять отзывы')), ('is_active', models.BooleanField
        (default=True, verbose_name='Активна ли компания'))], options={
        'verbose_name': 'Организация', 'verbose_name_plural': 'Организации',
        'db_table': 'Organization'}), migrations.CreateModel(name=
        'UserToken', fields=[('id', models.BigAutoField(auto_created=True,
        primary_key=True, serialize=False, verbose_name='ID')), ('key',
        models.UUIDField(db_index=True, default=uuid.uuid4, editable=False,
        unique=True)), ('created_at', models.DateTimeField(auto_now_add=
        True)), ('activated', models.BooleanField(default=False)), ('user',
        models.OneToOneField(on_delete=django.db.models.deletion.CASCADE,
        related_name='user_token', to='accounts.employee'))], options={
        'verbose_name': 'Токен пользователя', 'verbose_name_plural':
        'Токены Пользователей', 'db_table': 'UserTokens'}), migrations.
        CreateModel(name='Review', fields=[('id', models.BigAutoField(
        auto_created=True, primary_key=True, serialize=False, verbose_name=
        'ID')), ('created_at', models.DateTimeField(auto_now_add=True)), (
        'updated_at', models.DateTimeField(auto_now=True)), ('text_review',
        models.TextField(max_length=500, verbose_name='текст отзыва')), (
        'user_name', models.ForeignKey(on_delete=django.db.models.deletion.
        CASCADE, related_name='review_name', to='accounts.employee',
        verbose_name='имя пользователя'))], options={'verbose_name':
        'Отзыв', 'verbose_name_plural': 'Отзывы', 'db_table': 'Reviews'}),
        migrations.AddField(model_name='employee', name='organization_id',
        field=models.ForeignKey(blank=True, null=True, on_delete=django.db.
        models.deletion.CASCADE, related_name='employe_org', to=
        'accounts.organization', verbose_name='Внешний ключ на организацию'
        )), migrations.CreateModel(name='BalanceChange', fields=[('id',
        models.BigAutoField(auto_created=True, primary_key=True, serialize=
        False, verbose_name='ID')), ('type', models.CharField(choices=[(
        'accrual', 'Начисление'), ('write-off', 'Списание')], max_length=
        200, verbose_name='Тип')), ('sum_balance', models.IntegerField(
        default=0, validators=[django.core.validators.MinValueValidator(1)],
        verbose_name='Сумма')), ('comment', models.CharField(blank=True,
        max_length=1000, null=True, verbose_name='Комментарий')), (
        'created_at', models.DateTimeField(auto_now_add=True)), (
        'balance_after_transaction', models.IntegerField(blank=True, null=
        True)), ('employee', models.ForeignKey(on_delete=django.db.models.
        deletion.CASCADE, related_name='bal_em', to='accounts.employee',
        verbose_name='Пользователь'))], options={'verbose_name':
        'Изменение Баланса', 'verbose_name_plural': 'Изменение Балансов',
        'db_table': 'BalanceChange'})]

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


class Migration(migrations.Migration):
    initial = True
    dependencies = []
    operations = [migrations.CreateModel(name='Employee', fields=[('id',
        models.BigAutoField(auto_created=True, primary_key=True, serialize=
        False, verbose_name='ID')), ('tg_username', models.CharField(
        max_length=128, verbose_name='Юзернейм телеграм юзера')), ('tg_id',
        models.CharField(max_length=128, verbose_name='ID телеграм юзера')),
        ('tg_firstname', models.CharField(blank=True, max_length=128, null=
        True, verbose_name='Имя телеграм юзера')), ('tg_lastname', models.
        CharField(blank=True, max_length=128, null=True, verbose_name=
        'Фамилия телеграм юзера')), ('username', models.CharField(blank=
        True, max_length=200, null=True, unique=True, validators=[django.
        core.validators.MinLengthValidator(3)], verbose_name='Username')),
        ('is_active', models.BooleanField(default=True, verbose_name=
        'Активен ли пользователь')), ('is_admin', models.BooleanField(
        default=False)), ('total_balance', models.IntegerField(blank=True,
        default=0, null=True, verbose_name='Общий баланс'))], options={
        'verbose_name': 'Пользователь', 'verbose_name_plural':
        'Пользователи', 'db_table': 'Users'}), migrations.CreateModel(name=
        'Organization', fields=[('id', models.BigAutoField(auto_created=
        True, primary_key=True, serialize=False, verbose_name='ID')), (
        'name', models.CharField(max_length=300, verbose_name=
        'Название компании')), ('secondary_key', models.UUIDField(db_index=
        True, default=uuid.uuid4, editable=False, unique=True, verbose_name
        ='Вторичный ключ(UUID)')), ('payment', models.CharField(choices=[(
        'actual', 'фактический расчет'), ('cumulative',
        'накопительный расчет')], default=('actual', 'фактический расчет'),
        max_length=400, verbose_name='Тип расчета')), ('address', models.
        CharField(default='Bishkek', max_length=400, verbose_name=
        'Адрес компании')), ('bonus_activation', models.BooleanField(
        default=False, verbose_name='Возможность активирования бонуса')), (
        'leave_review', models.BooleanField(default=True, verbose_name=
        'Возможность оставлять отзывы')), ('is_active', models.BooleanField
        (default=True, verbose_name='Активна ли компания'))], options={
        'verbose_name': 'Организация', 'verbose_name_plural': 'Организации',
        'db_table': 'Organization'}), migrations.CreateModel(name=
        'UserToken', fields=[('id', models.BigAutoField(auto_created=True,
        primary_key=True, serialize=False, verbose_name='ID')), ('key',
        models.UUIDField(db_index=True, default=uuid.uuid4, editable=False,
        unique=True)), ('created_at', models.DateTimeField(auto_now_add=
        True)), ('activated', models.BooleanField(default=False)), ('user',
        models.OneToOneField(on_delete=django.db.models.deletion.CASCADE,
        related_name='user_token', to='accounts.employee'))], options={
        'verbose_name': 'Токен пользователя', 'verbose_name_plural':
        'Токены Пользователей', 'db_table': 'UserTokens'}), migrations.
        CreateModel(name='Review', fields=[('id', models.BigAutoField(
        auto_created=True, primary_key=True, serialize=False, verbose_name=
        'ID')), ('created_at', models.DateTimeField(auto_now_add=True)), (
        'updated_at', models.DateTimeField(auto_now=True)), ('text_review',
        models.TextField(max_length=500, verbose_name='текст отзыва')), (
        'user_name', models.ForeignKey(on_delete=django.db.models.deletion.
        CASCADE, related_name='review_name', to='accounts.employee',
        verbose_name='имя пользователя'))], options={'verbose_name':
        'Отзыв', 'verbose_name_plural': 'Отзывы', 'db_table': 'Reviews'}),
        migrations.AddField(model_name='employee', name='organization_id',
        field=models.ForeignKey(blank=True, null=True, on_delete=django.db.
        models.deletion.CASCADE, related_name='employe_org', to=
        'accounts.organization', verbose_name='Внешний ключ на организацию'
        )), migrations.CreateModel(name='BalanceChange', fields=[('id',
        models.BigAutoField(auto_created=True, primary_key=True, serialize=
        False, verbose_name='ID')), ('type', models.CharField(choices=[(
        'accrual', 'Начисление'), ('write-off', 'Списание')], max_length=
        200, verbose_name='Тип')), ('sum_balance', models.IntegerField(
        default=0, validators=[django.core.validators.MinValueValidator(1)],
        verbose_name='Сумма')), ('comment', models.CharField(blank=True,
        max_length=1000, null=True, verbose_name='Комментарий')), (
        'created_at', models.DateTimeField(auto_now_add=True)), (
        'balance_after_transaction', models.IntegerField(blank=True, null=
        True)), ('employee', models.ForeignKey(on_delete=django.db.models.
        deletion.CASCADE, related_name='bal_em', to='accounts.employee',
        verbose_name='Пользователь'))], options={'verbose_name':
        'Изменение Баланса', 'verbose_name_plural': 'Изменение Балансов',
        'db_table': 'BalanceChange'})]

# Generated by Django 3.2.4 on 2021-08-18 08:12

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Employee',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('tg_username', models.CharField(max_length=128, verbose_name='Юзернейм телеграм юзера')),
                ('tg_id', models.CharField(max_length=128, verbose_name='ID телеграм юзера')),
                ('tg_firstname', models.CharField(blank=True, max_length=128, null=True, verbose_name='Имя телеграм юзера')),
                ('tg_lastname', models.CharField(blank=True, max_length=128, null=True, verbose_name='Фамилия телеграм юзера')),
                ('username', models.CharField(blank=True, max_length=200, null=True, unique=True, validators=[django.core.validators.MinLengthValidator(3)], verbose_name='Username')),
                ('is_active', models.BooleanField(default=True, verbose_name='Активен ли пользователь')),
                ('is_admin', models.BooleanField(default=False)),
                ('total_balance', models.IntegerField(blank=True, default=0, null=True, verbose_name='Общий баланс')),
            ],
            options={
                'verbose_name': 'Пользователь',
                'verbose_name_plural': 'Пользователи',
                'db_table': 'Users',
            },
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=300, verbose_name='Название компании')),
                ('secondary_key', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True, verbose_name='Вторичный ключ(UUID)')),
                ('payment', models.CharField(choices=[('actual', 'фактический расчет'), ('cumulative', 'накопительный расчет')], default=('actual', 'фактический расчет'), max_length=400, verbose_name='Тип расчета')),
                ('address', models.CharField(default='Bishkek', max_length=400, verbose_name='Адрес компании')),
                ('bonus_activation', models.BooleanField(default=False, verbose_name='Возможность активирования бонуса')),
                ('leave_review', models.BooleanField(default=True, verbose_name='Возможность оставлять отзывы')),
                ('is_active', models.BooleanField(default=True, verbose_name='Активна ли компания')),
            ],
            options={
                'verbose_name': 'Организация',
                'verbose_name_plural': 'Организации',
                'db_table': 'Organization',
            },
        ),
        migrations.CreateModel(
            name='UserToken',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('key', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('activated', models.BooleanField(default=False)),
                ('user', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, related_name='user_token', to='accounts.employee')),
            ],
            options={
                'verbose_name': 'Токен пользователя',
                'verbose_name_plural': 'Токены Пользователей',
                'db_table': 'UserTokens',
            },
        ),
        migrations.CreateModel(
            name='Review',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True)),
                ('text_review', models.TextField(max_length=500, verbose_name='текст отзыва')),
                ('user_name', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='review_name', to='accounts.employee', verbose_name='имя пользователя')),
            ],
            options={
                'verbose_name': 'Отзыв',
                'verbose_name_plural': 'Отзывы',
                'db_table': 'Reviews',
            },
        ),
        migrations.AddField(
            model_name='employee',
            name='organization_id',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, related_name='employe_org', to='accounts.organization', verbose_name='Внешний ключ на организацию'),
        ),
        migrations.CreateModel(
            name='BalanceChange',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('type', models.CharField(choices=[('accrual', 'Начисление'), ('write-off', 'Списание')], max_length=200, verbose_name='Тип')),
                ('sum_balance', models.IntegerField(default=0, validators=[django.core.validators.MinValueValidator(1)], verbose_name='Сумма')),
                ('comment', models.CharField(blank=True, max_length=1000, null=True, verbose_name='Комментарий')),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('balance_after_transaction', models.IntegerField(blank=True, null=True)),
                ('employee', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='bal_em', to='accounts.employee', verbose_name='Пользователь')),
            ],
            options={
                'verbose_name': 'Изменение Баланса',
                'verbose_name_plural': 'Изменение Балансов',
                'db_table': 'BalanceChange',
            },
        ),
    ]
