diff --git a/cinema/migrations/0001_initial.py b/cinema/migrations/0001_initial.py new file mode 100644 index 000000000..549001826 --- /dev/null +++ b/cinema/migrations/0001_initial.py @@ -0,0 +1,94 @@ +# Generated by Django 4.1 on 2023-11-09 11:55 + +from django.db import migrations, models +import django.db.models.deletion + + +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=150)), + ("last_name", models.CharField(max_length=150)), + ], + ), + 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()), + ("seat_in_rows", 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)), + ], + ), + 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.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="actor_movies", + to="cinema.actor", + ), + ), + ( + "genres", + models.ForeignKey( + on_delete=django.db.models.deletion.CASCADE, + related_name="genre_movies", + to="cinema.genre", + ), + ), + ], + ), + ] diff --git a/cinema/migrations/0002_rename_seat_in_rows_cinemahall_seats_in_row.py b/cinema/migrations/0002_rename_seat_in_rows_cinemahall_seats_in_row.py new file mode 100644 index 000000000..2d3c1c07a --- /dev/null +++ b/cinema/migrations/0002_rename_seat_in_rows_cinemahall_seats_in_row.py @@ -0,0 +1,17 @@ +# Generated by Django 4.1 on 2023-11-09 11:56 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("cinema", "0001_initial"), + ] + + operations = [ + migrations.RenameField( + model_name="cinemahall", + old_name="seat_in_rows", + new_name="seats_in_row", + ), + ] diff --git a/cinema/migrations/0003_remove_movie_actors_remove_movie_genres_movie_actors_and_more.py b/cinema/migrations/0003_remove_movie_actors_remove_movie_genres_movie_actors_and_more.py new file mode 100644 index 000000000..0b0196336 --- /dev/null +++ b/cinema/migrations/0003_remove_movie_actors_remove_movie_genres_movie_actors_and_more.py @@ -0,0 +1,34 @@ +# Generated by Django 4.1 on 2023-11-09 12:31 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("cinema", "0002_rename_seat_in_rows_cinemahall_seats_in_row"), + ] + + operations = [ + migrations.RemoveField( + model_name="movie", + name="actors", + ), + migrations.RemoveField( + model_name="movie", + name="genres", + ), + migrations.AddField( + model_name="movie", + name="actors", + field=models.ManyToManyField( + related_name="actor_movies", to="cinema.actor" + ), + ), + migrations.AddField( + model_name="movie", + name="genres", + field=models.ManyToManyField( + related_name="genre_movies", to="cinema.genre" + ), + ), + ] diff --git a/cinema/migrations/0004_alter_movie_actors_alter_movie_genres.py b/cinema/migrations/0004_alter_movie_actors_alter_movie_genres.py new file mode 100644 index 000000000..60e00da17 --- /dev/null +++ b/cinema/migrations/0004_alter_movie_actors_alter_movie_genres.py @@ -0,0 +1,29 @@ +# Generated by Django 4.1 on 2023-11-24 19:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ( + "cinema", + "0003_remove_movie_actors_remove_movie_genres_movie_actors_and_more", + ), + ] + + operations = [ + migrations.AlterField( + model_name="movie", + name="actors", + field=models.ManyToManyField( + null=True, related_name="actor_movies", to="cinema.actor" + ), + ), + migrations.AlterField( + model_name="movie", + name="genres", + field=models.ManyToManyField( + null=True, related_name="genre_movies", to="cinema.genre" + ), + ), + ] diff --git a/cinema/migrations/0005_alter_movie_actors_alter_movie_genres.py b/cinema/migrations/0005_alter_movie_actors_alter_movie_genres.py new file mode 100644 index 000000000..e768f4857 --- /dev/null +++ b/cinema/migrations/0005_alter_movie_actors_alter_movie_genres.py @@ -0,0 +1,26 @@ +# Generated by Django 4.1 on 2023-11-24 19:12 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ("cinema", "0004_alter_movie_actors_alter_movie_genres"), + ] + + operations = [ + migrations.AlterField( + model_name="movie", + name="actors", + field=models.ManyToManyField( + related_name="actor_movies", to="cinema.actor" + ), + ), + migrations.AlterField( + model_name="movie", + name="genres", + field=models.ManyToManyField( + related_name="genre_movies", to="cinema.genre" + ), + ), + ]