# Generated by Django 3.2.3 on 2021-05-28 08:38

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Hall',
            fields=[
                ('hall_id', models.AutoField(primary_key=True, serialize=False)),
                ('number_of_seats', models.PositiveIntegerField(default=0)),
            ],
        ),
        migrations.CreateModel(
            name='Movie',
            fields=[
                ('imdb_id', models.CharField(max_length=10, primary_key=True, serialize=False)),
                ('title', models.CharField(max_length=100)),
                ('released', models.CharField(max_length=50)),
                ('duration', models.CharField(max_length=10)),
                ('genre', models.CharField(max_length=100)),
                ('director', models.CharField(max_length=100)),
                ('writer', models.CharField(max_length=500)),
                ('actors', models.CharField(max_length=200)),
                ('plot', models.CharField(max_length=500)),
                ('language', models.CharField(max_length=50)),
                ('awards', models.CharField(max_length=200)),
                ('poster', models.CharField(max_length=300)),
                ('imdb_rating', models.CharField(max_length=6)),
            ],
        ),
        migrations.CreateModel(
            name='Running_movie',
            fields=[
                ('running_id', models.AutoField(primary_key=True, serialize=False)),
                ('date', models.CharField(max_length=12)),
                ('time', models.CharField(max_length=5)),
                ('occupied_seats', models.PositiveIntegerField(default=0)),
                ('hall', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cinehub_backend.hall')),
                ('movie', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cinehub_backend.movie')),
            ],
        ),
        migrations.CreateModel(
            name='Booking',
            fields=[
                ('booking_id', models.AutoField(primary_key=True, serialize=False)),
                ('seats', models.CharField(max_length=200)),
                ('user_id', models.CharField(max_length=30)),
                ('running', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='cinehub_backend.running_movie')),
            ],
        ),
        migrations.AddConstraint(
            model_name='running_movie',
            constraint=models.UniqueConstraint(fields=('movie_id', 'hall_id'), name='unique_movie_hall'),
        ),
        migrations.AddConstraint(
            model_name='running_movie',
            constraint=models.UniqueConstraint(fields=('date', 'time', 'hall_id'), name='unique_movie_date_time'),
        ),
    ]
