<reponame>dagolap/liquidator-backend
# Generated by Django 2.2.2 on 2019-06-21 14:57

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0002_auto_20190621_0935'),
        ('transaction', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TransactionTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('money', models.IntegerField()),
                ('type', models.CharField(choices=[('IN', 'income'), ('EX', 'expense')], max_length=2)),
                ('description', models.TextField()),
                ('notes', models.TextField(blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='RecurringTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day_delta', models.PositiveIntegerField()),
                ('month_delta', models.PositiveIntegerField()),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recurring_transactions', to='company.Company')),
                ('template', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='transaction.TransactionTemplate')),
            ],
        ),
        migrations.AddField(
            model_name='transaction',
            name='recurring_transaction',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transactions', to='transaction.RecurringTransaction'),
        ),
    ]

# Generated by Django 2.2.2 on 2019-06-21 14:57

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


class Migration(migrations.Migration):

    dependencies = [
        ('company', '0002_auto_20190621_0935'),
        ('transaction', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='TransactionTemplate',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('money', models.IntegerField()),
                ('type', models.CharField(choices=[('IN', 'income'), ('EX', 'expense')], max_length=2)),
                ('description', models.TextField()),
                ('notes', models.TextField(blank=True)),
            ],
            options={
                'abstract': False,
            },
        ),
        migrations.CreateModel(
            name='RecurringTransaction',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('day_delta', models.PositiveIntegerField()),
                ('month_delta', models.PositiveIntegerField()),
                ('start_date', models.DateField()),
                ('end_date', models.DateField()),
                ('company', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='recurring_transactions', to='company.Company')),
                ('template', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='transaction.TransactionTemplate')),
            ],
        ),
        migrations.AddField(
            model_name='transaction',
            name='recurring_transaction',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.DO_NOTHING, related_name='transactions', to='transaction.RecurringTransaction'),
        ),
    ]
# Generated by Django 2.2.2 on 2019-06-21 14:57