From b9e79e9f902e36d996f045a7587f21b660346875 Mon Sep 17 00:00:00 2001 From: Alexander Baidin Date: Mon, 30 Sep 2024 02:44:53 +0300 Subject: [PATCH] add migration --- ...all_genre_alter_movie_duration_and_more.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 cinema/migrations/0002_actor_cinemahall_genre_alter_movie_duration_and_more.py diff --git a/cinema/migrations/0002_actor_cinemahall_genre_alter_movie_duration_and_more.py b/cinema/migrations/0002_actor_cinemahall_genre_alter_movie_duration_and_more.py new file mode 100644 index 000000000..6b7e664d4 --- /dev/null +++ b/cinema/migrations/0002_actor_cinemahall_genre_alter_movie_duration_and_more.py @@ -0,0 +1,76 @@ +# Generated by Django 4.1 on 2024-09-29 22:30 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("cinema", "0001_initial"), + ] + + 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=63)), + ("last_name", models.CharField(max_length=63)), + ], + ), + 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.PositiveIntegerField()), + ("seats_in_row", models.PositiveIntegerField()), + ], + ), + 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)), + ], + ), + migrations.AlterField( + model_name="movie", + name="duration", + field=models.PositiveIntegerField(), + ), + migrations.AddField( + model_name="movie", + name="actors", + field=models.ManyToManyField(related_name="movies", to="cinema.actor"), + ), + migrations.AddField( + model_name="movie", + name="genres", + field=models.ManyToManyField(related_name="movies", to="cinema.genre"), + ), + ]