# Generated by Django 3.1.1 on 2020-09-18 01:37

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),
    ]

    operations = [
        migrations.CreateModel(
            name='Plan',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('title', models.CharField(max_length=255)),
                ('price', models.DecimalField(decimal_places=2, max_digits=10, unique=True)),
                ('recurring_interval', models.CharField(choices=[('week', 'Week'), ('month', 'Month'), ('year', 'Year')], default='year', max_length=255)),
                ('product_id', models.CharField(blank=True, max_length=255, null=True)),
                ('price_id', models.CharField(blank=True, max_length=255, null=True)),
                ('published', models.BooleanField(default=True)),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('is_active', models.BooleanField(default=False)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('updated_at', models.DateTimeField(auto_now=True, null=True)),
                ('customer_id', models.CharField(blank=True, max_length=255, null=True)),
                ('subscription_id', models.CharField(blank=True, max_length=255, null=True)),
                ('plan', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='stripe_subscription.plan')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ]
        ),
    ]

    perations = [
        migrations.AlterUniqueTogether(
            name='Subscription',
            unique_together={('user', 'plan')},
        ),
    ]
