From 90303611e2d024da4528d2255d2158eb4d6c56a0 Mon Sep 17 00:00:00 2001 From: Maksym Protsak <112944888+MaksymProtsak@users.noreply.github.com> Date: Fri, 1 Nov 2024 16:54:52 +0200 Subject: [PATCH] Created initial migration file. --- cinema/migrations/0001_initial.py | 49 +++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 cinema/migrations/0001_initial.py diff --git a/cinema/migrations/0001_initial.py b/cinema/migrations/0001_initial.py new file mode 100644 index 000000000..13d637116 --- /dev/null +++ b/cinema/migrations/0001_initial.py @@ -0,0 +1,49 @@ +# Generated by Django 4.1 on 2024-11-01 14:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Actor', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('first_name', models.CharField(max_length=255)), + ('last_name', models.CharField(max_length=255)), + ], + ), + migrations.CreateModel( + name='CinemaHall', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('rows', models.IntegerField()), + ('seats_in_row', models.IntegerField()), + ], + ), + migrations.CreateModel( + name='Genre', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255, unique=True)), + ], + ), + migrations.CreateModel( + name='Movie', + fields=[ + ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('title', models.CharField(max_length=255)), + ('description', models.TextField()), + ('duration', models.IntegerField()), + ('actors', models.ManyToManyField(related_name='movies', to='cinema.actor')), + ('genres', models.ManyToManyField(related_name='movies', to='cinema.genre')), + ], + ), + ]