# Generated by Django 3.0.3 on 2020-07-18 13:56

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import subscriptions.plans
import subscriptions.states


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')),
                ('plan', models.IntegerField(choices=[(2, 'TRIAL'), (199, 'BASIC'), (399, 'PREMIUM'), (799, 'DIAMOND')], default=subscriptions.plans.SubscriptionPlan['BASIC'], help_text='amount for searches', unique=True)),
            ],
        ),
        migrations.CreateModel(
            name='Subscription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('status', models.IntegerField(choices=[(1, 'ACTIVE'), (2, 'DEACTIVATED')], default=subscriptions.states.SubscriptionState['ACTIVE'], help_text='current subscription status of the user')),
                ('searches_completed', models.IntegerField(default=0, help_text='searches completed')),
                ('plan', models.ForeignKey(null=True, on_delete=django.db.models.deletion.PROTECT, related_name='subscription_plan', to='subscriptions.Plan')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='user_profile_subscription', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'ordering': ('-searches_completed',),
            },
        ),
    ]
