# -*- coding: utf-8 -*-
# Generated by Django 1.10.3 on 2017-05-05 20:31
from __future__ import unicode_literals

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='Organization',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
            ],
        ),
        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='MyPurchase',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('for_organization', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='for_purchase', to='debits_test.Organization')),
                ('item', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='debits_base.SubscriptionItem')),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='debits_test.PricingPlan')),
            ],
        ),
        migrations.AddField(
            model_name='organization',
            name='purchase',
            field=models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, to='debits_test.MyPurchase'),
        ),
    ]
