<filename>stream/migrations/0001_init_models.py
# Generated by Django 3.1.5 on 2021-03-17 21:30

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Movie",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("imdb_id", models.CharField(max_length=10)),
                ("title", models.CharField(blank=True, max_length=120)),
                ("description", models.TextField(blank=True, null=True)),
                ("moviedb_popularity", models.FloatField(blank=True, null=True)),
                (
                    "poster_path_big",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "poster_path_small",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "backdrop_path_big",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "backdrop_path_small",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("duration", models.IntegerField(default=0)),
                ("media_info_raw", models.JSONField(blank=True, default=dict)),
                ("imdb_score", models.FloatField(default=0.0)),
                (
                    "original_language",
                    models.CharField(blank=True, max_length=2, null=True),
                ),
                ("release_date", models.DateField(blank=True, null=True)),
                ("is_adult", models.BooleanField(default=False)),
                ("is_ready", models.BooleanField(default=False)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="MovieDBCategory",
            fields=[
                ("moviedb_id", models.IntegerField(primary_key=True, serialize=False)),
                ("name", models.CharField(max_length=20)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="MovieSubtitle",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("full_path", models.CharField(max_length=255)),
                ("relative_path", models.CharField(max_length=255)),
                ("file_name", models.CharField(max_length=255)),
                ("suffix", models.CharField(max_length=7)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="UserMovieHistory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("current_second", models.IntegerField(default=0)),
                ("remaining_seconds", models.IntegerField(default=0)),
                ("is_watched", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "movie",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="history",
                        to="stream.movie",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="MyList",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "movie",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="my_list",
                        to="stream.movie",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="MovieContent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("torrent_source", models.TextField(null=True)),
                ("full_path", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "relative_path",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "main_folder",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("file_name", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "file_extension",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "source_file_name",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "source_file_extension",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("resolution_width", models.IntegerField(default=0)),
                ("resolution_height", models.IntegerField(default=0)),
                ("raw_info", models.TextField(blank=True, null=True)),
                ("is_ready", models.BooleanField(default=False)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "movie_subtitle",
                    models.ManyToManyField(blank=True, to="stream.MovieSubtitle"),
                ),
            ],
        ),
        migrations.AddField(
            model_name="movie",
            name="movie_content",
            field=models.ManyToManyField(to="stream.MovieContent"),
        ),
        migrations.AddField(
            model_name="movie",
            name="moviedb_category",
            field=models.ManyToManyField(blank=True, to="stream.MovieDBCategory"),
        ),
    ]

<filename>stream/migrations/0001_init_models.py
# Generated by Django 3.1.5 on 2021-03-17 21:30

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name="Movie",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("imdb_id", models.CharField(max_length=10)),
                ("title", models.CharField(blank=True, max_length=120)),
                ("description", models.TextField(blank=True, null=True)),
                ("moviedb_popularity", models.FloatField(blank=True, null=True)),
                (
                    "poster_path_big",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "poster_path_small",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "backdrop_path_big",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "backdrop_path_small",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("duration", models.IntegerField(default=0)),
                ("media_info_raw", models.JSONField(blank=True, default=dict)),
                ("imdb_score", models.FloatField(default=0.0)),
                (
                    "original_language",
                    models.CharField(blank=True, max_length=2, null=True),
                ),
                ("release_date", models.DateField(blank=True, null=True)),
                ("is_adult", models.BooleanField(default=False)),
                ("is_ready", models.BooleanField(default=False)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="MovieDBCategory",
            fields=[
                ("moviedb_id", models.IntegerField(primary_key=True, serialize=False)),
                ("name", models.CharField(max_length=20)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="MovieSubtitle",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("full_path", models.CharField(max_length=255)),
                ("relative_path", models.CharField(max_length=255)),
                ("file_name", models.CharField(max_length=255)),
                ("suffix", models.CharField(max_length=7)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
            ],
        ),
        migrations.CreateModel(
            name="UserMovieHistory",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("current_second", models.IntegerField(default=0)),
                ("remaining_seconds", models.IntegerField(default=0)),
                ("is_watched", models.BooleanField(default=False)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                (
                    "movie",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="history",
                        to="stream.movie",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="MyList",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "movie",
                    models.OneToOneField(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="my_list",
                        to="stream.movie",
                    ),
                ),
                (
                    "user",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to=settings.AUTH_USER_MODEL,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="MovieContent",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("torrent_source", models.TextField(null=True)),
                ("full_path", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "relative_path",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "main_folder",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("file_name", models.CharField(blank=True, max_length=255, null=True)),
                (
                    "file_extension",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "source_file_name",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                (
                    "source_file_extension",
                    models.CharField(blank=True, max_length=255, null=True),
                ),
                ("resolution_width", models.IntegerField(default=0)),
                ("resolution_height", models.IntegerField(default=0)),
                ("raw_info", models.TextField(blank=True, null=True)),
                ("is_ready", models.BooleanField(default=False)),
                ("updated_at", models.DateTimeField(auto_now=True)),
                ("created_at", models.DateTimeField(auto_now_add=True)),
                (
                    "movie_subtitle",
                    models.ManyToManyField(blank=True, to="stream.MovieSubtitle"),
                ),
            ],
        ),
        migrations.AddField(
            model_name="movie",
            name="movie_content",
            field=models.ManyToManyField(to="stream.MovieContent"),
        ),
        migrations.AddField(
            model_name="movie",
            name="moviedb_category",
            field=models.ManyToManyField(blank=True, to="stream.MovieDBCategory"),
        ),
    ]

# Generated by Django 3.1.5 on 2021-03-17 21:30