From 789934eb0aa6ddd208ed2a8a7adb52d8c1b36ed4 Mon Sep 17 00:00:00 2001 From: Serhii Date: Wed, 29 Nov 2023 22:55:07 +0200 Subject: [PATCH] migrations added --- ...emahall_genre_movie_actors_movie_genres.py | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 cinema/migrations/0002_actor_cinemahall_genre_movie_actors_movie_genres.py diff --git a/cinema/migrations/0002_actor_cinemahall_genre_movie_actors_movie_genres.py b/cinema/migrations/0002_actor_cinemahall_genre_movie_actors_movie_genres.py new file mode 100644 index 000000000..44b299255 --- /dev/null +++ b/cinema/migrations/0002_actor_cinemahall_genre_movie_actors_movie_genres.py @@ -0,0 +1,70 @@ +# Generated by Django 4.1 on 2023-11-29 18:40 + +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=63)), + ("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=63, unique=True)), + ], + ), + 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"), + ), + ]