# Generated by Django 2.2.1 on 2019-05-07 16:00

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('debits_base', '0001_initial'),
    ]

    operations = [
        migrations.CreateModel(
            name='MyPurchase',
            fields=[
                ('subscriptionpurchase_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='debits_base.SubscriptionPurchase')),
            ],
            bases=('debits_base.subscriptionpurchase',),
        ),
        migrations.CreateModel(
            name='PricingPlan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10)),
                ('currency', models.CharField(max_length=3)),
                ('period_unit', models.SmallIntegerField()),
                ('period_count', models.SmallIntegerField()),
                ('product', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='debits_base.Product')),
            ],
        ),
        migrations.CreateModel(
            name='Organization',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('purchase', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='debits_test.MyPurchase')),
            ],
        ),
        migrations.AddField(
            model_name='mypurchase',
            name='for_organization',
            field=models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='for_purchase', to='debits_test.Organization'),
        ),
        migrations.AddField(
            model_name='mypurchase',
            name='plan',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='debits_test.PricingPlan'),
        ),
    ]
