text: # Generated by Django 3.1.7 on 2021-03-23 07:34
  
  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),
          ('banks', '0001_initial'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Debt',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_at', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Дата создания')),
                  ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата изменения')),
                  ('with_whom', models.CharField(max_length=100)),
                  ('amount', models.FloatField(default=0)),
                  ('amount_left', models.FloatField(default=0)),
                  ('to_me', models.BooleanField(default=False)),
                  ('debt_date', models.DateTimeField(blank=True, null=True)),
                  ('return_date', models.DateTimeField(blank=True, null=True)),
                  ('description', models.TextField(blank=True, null=True)),
                  ('bank', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='debts', to='banks.bank')),
              ],
              options={
                  'verbose_name': 'Долг',
                  'verbose_name_plural': 'Долги',
              },
          ),
          migrations.CreateModel(
              name='OperationCategory',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=100)),
                  ('slug', models.SlugField(max_length=100, unique=True)),
              ],
              options={
                  'verbose_name': 'Категория операции',
                  'verbose_name_plural': 'Категории операций',
              },
          ),
          migrations.CreateModel(
              name='Transfer',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_at', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Дата создания')),
                  ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата изменения')),
                  ('amount', models.FloatField(default=0)),
                  ('description', models.TextField(blank=True, null=True)),
                  ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers', to='debts.operationcategory')),
                  ('from_bank', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='from_transfers', to='banks.bank')),
                  ('to_bank', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='to_transfers', to='banks.bank')),
                  ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='transfers', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'verbose_name': 'Переводы по счетам',
              },
          ),
          migrations.CreateModel(
              name='Operation',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_at', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Дата создания')),
                  ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата изменения')),
                  ('type', models.CharField(choices=[('+', 'Прибыль'), ('-', 'Убыток')], max_length=10)),
                  ('amount', models.FloatField(default=0)),
                  ('description', models.TextField(blank=True, null=True)),
                  ('bank', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operations', to='banks.bank')),
                  ('category', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operations', to='debts.operationcategory')),
                  ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='operations', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'verbose_name': 'Операция',
                  'verbose_name_plural': 'Операции',
              },
          ),
          migrations.CreateModel(
              name='DebtRepayment',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('created_at', models.DateTimeField(auto_now_add=True, null=True, verbose_name='Дата создания')),
                  ('updated_at', models.DateTimeField(auto_now=True, null=True, verbose_name='Дата изменения')),
                  ('amount', models.FloatField(default=0)),
                  ('bank', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, to='banks.bank')),
                  ('debt', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='debt_payments', to='debts.debt')),
                  ('user', models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='debt_payments', to=settings.AUTH_USER_MODEL)),
              ],
              options={
                  'verbose_name': 'Возврат долга',
                  'verbose_name_plural': 'Возвраты долгов',
              },
          ),
          migrations.AddField(
              model_name='debt',
              name='category',
              field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='debts', to='debts.operationcategory'),
          ),
          migrations.AddField(
              model_name='debt',
              name='owner',
              field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='debts', to=settings.AUTH_USER_MODEL),
          ),
      ]
  