text: # Generated by Django 3.1 on 2020-08-14 15:52
  
  import datetime
  from django.db import migrations, models
  import django.db.models.deletion
  import django.db.models.fields
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = []
  
      operations = [
          migrations.CreateModel(
              name="Actor",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("name", models.CharField(max_length=100, verbose_name="Name")),
                  (
                      "age",
                      models.PositiveSmallIntegerField(default=0, verbose_name="Age"),
                  ),
                  ("description", models.TextField(verbose_name="Description")),
                  ("image", models.ImageField(upload_to="actors/", verbose_name="Image")),
              ],
              options={
                  "verbose_name": "Аctors and directors",
                  "verbose_name_plural": "Аctors and directors",
              },
          ),
          migrations.CreateModel(
              name="Category",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("name", models.CharField(max_length=150, verbose_name="Category")),
                  ("description", models.TextField(verbose_name="Description")),
                  ("url", models.SlugField(max_length=160, unique=True)),
              ],
              options={"verbose_name": "Category", "verbose_name_plural": "Categories",},
          ),
          migrations.CreateModel(
              name="Genre",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("name", models.CharField(max_length=150, verbose_name="Name")),
                  ("description", models.TextField(verbose_name="Description")),
                  ("url", models.SlugField(max_length=160, unique=True)),
              ],
              options={"verbose_name": "Genre", "verbose_name_plural": "Genres",},
          ),
          migrations.CreateModel(
              name="Movie",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("title", models.CharField(max_length=100, verbose_name="Name")),
                  (
                      "tagline",
                      models.CharField(
                          default="", max_length=100, verbose_name="Tagline"
                      ),
                  ),
                  ("description", models.TextField(verbose_name="Description")),
                  (
                      "poster",
                      models.ImageField(upload_to="movies/", verbose_name="POster"),
                  ),
                  (
                      "year",
                      models.PositiveSmallIntegerField(
                          default=2020, verbose_name="Release date"
                      ),
                  ),
                  ("country", models.CharField(max_length=100, verbose_name="Country")),
                  (
                      "world_premiere",
                      models.DateField(
                          default=datetime.date.today, verbose_name="World premiere"
                      ),
                  ),
                  (
                      "budget",
                      models.PositiveIntegerField(
                          default=0,
                          help_text="indicate the amount in dollars",
                          verbose_name="Budget",
                      ),
                  ),
                  (
                      "fees_in_use",
                      models.PositiveIntegerField(
                          default=0,
                          help_text="indicate the amount in dollars",
                          verbose_name="Fees_in_use",
                      ),
                  ),
                  (
                      "fees_in_world",
                      models.PositiveIntegerField(
                          default=0,
                          help_text="indicate the amount in dollars",
                          verbose_name="Fees in world",
                      ),
                  ),
                  ("url", models.SlugField(max_length=160, unique=True)),
                  ("draft", models.BooleanField(default=False, verbose_name="Draft")),
                  (
                      "actors",
                      models.ManyToManyField(
                          related_name="film_actor",
                          to="movies.Actor",
                          verbose_name="Actors",
                      ),
                  ),
                  (
                      "category",
                      models.ForeignKey(
                          null=True,
                          on_delete=django.db.models.deletion.SET_NULL,
                          to="movies.category",
                          verbose_name="category",
                      ),
                  ),
                  (
                      "directors",
                      models.ManyToManyField(
                          related_name="film_director",
                          to="movies.Actor",
                          verbose_name="director",
                      ),
                  ),
                  (
                      "genres",
                      models.ManyToManyField(to="movies.Genre", verbose_name="Genres"),
                  ),
              ],
              options={"verbose_name": "Movie", "verbose_name_plural": "Movies",},
          ),
          migrations.CreateModel(
              name="RatingStar",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("value", models.SmallIntegerField(default=0, verbose_name="Value")),
              ],
              options={
                  "verbose_name": "Rating star",
                  "verbose_name_plural": "Rating stars",
              },
          ),
          migrations.CreateModel(
              name="Reviews",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("email", models.EmailField(max_length=254)),
                  ("name", models.CharField(max_length=100, verbose_name="Name")),
                  ("text", models.TextField(max_length=5000, verbose_name="Message")),
                  (
                      "movie",
                      models.ForeignKey(
                          on_delete=django.db.models.deletion.CASCADE,
                          to="movies.movie",
                          verbose_name="Movie",
                      ),
                  ),
                  (
                      "parent",
                      models.ForeignKey(
                          blank=True,
                          null=True,
                          on_delete=django.db.models.deletion.SET_NULL,
                          to="movies.reviews",
                          verbose_name="Parent",
                      ),
                  ),
              ],
              options={"verbose_name": "Review", "verbose_name_plural": "Reviews",},
          ),
          migrations.CreateModel(
              name="Rating",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("ip", models.CharField(max_length=15, verbose_name="IP address")),
                  (
                      "movie",
                      models.ForeignKey(
                          on_delete=django.db.models.fields.CharField,
                          to="movies.movie",
                          verbose_name="Movie",
                      ),
                  ),
                  (
                      "star",
                      models.ForeignKey(
                          on_delete=django.db.models.deletion.CASCADE,
                          to="movies.ratingstar",
                          verbose_name="Star",
                      ),
                  ),
              ],
              options={"verbose_name": "Rating", "verbose_name_plural": "Ratings",},
          ),
          migrations.CreateModel(
              name="MovieShots",
              fields=[
                  (
                      "id",
                      models.AutoField(
                          auto_created=True,
                          primary_key=True,
                          serialize=False,
                          verbose_name="ID",
                      ),
                  ),
                  ("title", models.CharField(max_length=100, verbose_name="Title")),
                  ("description", models.TextField(verbose_name="Description")),
                  (
                      "image",
                      models.ImageField(upload_to="movie_shots/", verbose_name="Image"),
                  ),
                  (
                      "movie",
                      models.ForeignKey(
                          on_delete=django.db.models.deletion.CASCADE,
                          to="movies.movie",
                          verbose_name="Movie",
                      ),
                  ),
              ],
              options={
                  "verbose_name": "Shot from the movie",
                  "verbose_name_plural": "Shots from the movie",
              },
          ),
      ]
  