# Generated by Django 3.1.1 on 2020-09-07 20:10

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='ad_listing',
            fields=[
                ('ad_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('ad_name', models.CharField(max_length=150)),
                ('ad_price', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('is_ad_promoted', models.BooleanField(default=False)),
                ('is_deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='ad_type',
            fields=[
                ('type_id', models.IntegerField(primary_key=True, serialize=False, validators=[django.core.validators.MinValueValidator(1), django.core.validators.MaxValueValidator(5)])),
                ('type_name', models.CharField(max_length=50)),
                ('Is_deleted', models.BooleanField()),
            ],
        ),
        migrations.CreateModel(
            name='district',
            fields=[
                ('district_id', models.AutoField(primary_key=True, serialize=False)),
                ('district_name', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='parent_category',
            fields=[
                ('category_id', models.AutoField(primary_key=True, serialize=False)),
                ('category_name', models.CharField(max_length=100)),
                ('is_deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='promotion_package',
            fields=[
                ('promotion_id', models.AutoField(primary_key=True, serialize=False)),
                ('promotion_name', models.CharField(max_length=150)),
                ('promotion_cost', models.DecimalField(blank=True, decimal_places=2, max_digits=12, null=True)),
                ('is_deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='user',
            fields=[
                ('user_id', models.AutoField(primary_key=True, serialize=False)),
                ('username', models.CharField(max_length=100)),
                ('password', models.CharField(max_length=100)),
                ('first_name', models.CharField(max_length=150)),
                ('last_name', models.CharField(max_length=150)),
                ('contact', models.CharField(max_length=20)),
                ('json_token', models.CharField(max_length=100)),
                ('is_deleted', models.BooleanField(default=False)),
            ],
        ),
        migrations.CreateModel(
            name='sub_category',
            fields=[
                ('category_id', models.AutoField(primary_key=True, serialize=False)),
                ('category_name', models.CharField(max_length=120)),
                ('is_deleted', models.BooleanField(default=False)),
                ('parent_category', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.parent_category')),
            ],
        ),
        migrations.CreateModel(
            name='promoted_ad_detail',
            fields=[
                ('pa_ad_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField()),
                ('ad_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.ad_listing')),
                ('promotion_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.promotion_package')),
            ],
        ),
        migrations.CreateModel(
            name='payment',
            fields=[
                ('payment_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('payment_status', models.BooleanField(default=True)),
                ('promoted_ad_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.promoted_ad_detail')),
            ],
        ),
        migrations.CreateModel(
            name='image',
            fields=[
                ('image_id', models.BigAutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('ad_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.ad_listing')),
            ],
        ),
        migrations.CreateModel(
            name='feedback',
            fields=[
                ('feedback_id', models.AutoField(primary_key=True, serialize=False)),
                ('is_deleted', models.BooleanField(default=False)),
                ('commented_user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.user')),
            ],
        ),
        migrations.CreateModel(
            name='city',
            fields=[
                ('city_id', models.AutoField(primary_key=True, serialize=False)),
                ('city_name', models.CharField(max_length=70)),
                ('district_id', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.district')),
            ],
        ),
        migrations.AddField(
            model_name='ad_listing',
            name='ad_category',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.sub_category'),
        ),
        migrations.AddField(
            model_name='ad_listing',
            name='ad_posted_by',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.user'),
        ),
        migrations.AddField(
            model_name='ad_listing',
            name='ad_type',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.ad_type'),
        ),
        migrations.AddField(
            model_name='ad_listing',
            name='city',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='qts_api.city'),
        ),
    ]
