You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
373 lines
13 KiB
373 lines
13 KiB
# Generated by Django 4.2.27 on 2026-01-22 10:48
|
|
|
|
from django.db import migrations, models
|
|
import django.db.models.deletion
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="Video",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=255, null=True)),
|
|
("slug", models.SlugField(allow_unicode=True, unique=True)),
|
|
(
|
|
"thumbnail",
|
|
models.ImageField(
|
|
blank=True,
|
|
help_text="image allowed",
|
|
null=True,
|
|
upload_to="video/thumbnails/",
|
|
),
|
|
),
|
|
("description", models.TextField(null=True)),
|
|
(
|
|
"video_type",
|
|
models.CharField(
|
|
choices=[
|
|
("youtube_link", "Youtube Link"),
|
|
("video_file", "Video File"),
|
|
],
|
|
max_length=255,
|
|
),
|
|
),
|
|
(
|
|
"video_file",
|
|
models.FileField(blank=True, null=True, upload_to="video/videos/"),
|
|
),
|
|
("video_url", models.CharField(blank=True, max_length=655, null=True)),
|
|
("video_time", models.TimeField()),
|
|
(
|
|
"view_count",
|
|
models.PositiveBigIntegerField(
|
|
default=0, verbose_name="view count"
|
|
),
|
|
),
|
|
("status", models.BooleanField(default=True, verbose_name="status")),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
],
|
|
),
|
|
migrations.CreateModel(
|
|
name="VideoCategory",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=255, verbose_name="title")),
|
|
(
|
|
"slug",
|
|
models.SlugField(
|
|
allow_unicode=True, unique=True, verbose_name="slug"
|
|
),
|
|
),
|
|
("status", models.BooleanField(default=True, verbose_name="status")),
|
|
("order", models.PositiveIntegerField(default=0, verbose_name="order")),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Video Category",
|
|
"verbose_name_plural": "Video Categories",
|
|
"ordering": ["order"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="VideoCollection",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=255)),
|
|
("slug", models.SlugField(max_length=255, unique=True)),
|
|
(
|
|
"summary",
|
|
models.CharField(
|
|
blank=True, help_text="could be null", max_length=512, null=True
|
|
),
|
|
),
|
|
("pin_top", models.BooleanField(default=True, verbose_name="pin top")),
|
|
(
|
|
"thumbnail",
|
|
models.ImageField(
|
|
blank=True,
|
|
help_text="image allowed",
|
|
null=True,
|
|
upload_to="video/collection/",
|
|
),
|
|
),
|
|
("order", models.IntegerField(default=0, verbose_name="order")),
|
|
("status", models.BooleanField(default=True, verbose_name="status")),
|
|
(
|
|
"display_position",
|
|
models.CharField(
|
|
choices=[("pinned", "Pinned"), ("middle", "Middle Section")],
|
|
default="pinned",
|
|
max_length=20,
|
|
verbose_name="Display Position",
|
|
),
|
|
),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Video Collection",
|
|
"verbose_name_plural": "Video Collections",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="VideoPlaylist",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("title", models.CharField(max_length=255, verbose_name="title")),
|
|
(
|
|
"slug",
|
|
models.SlugField(
|
|
allow_unicode=True,
|
|
blank=True,
|
|
null=True,
|
|
unique=True,
|
|
verbose_name="slug",
|
|
),
|
|
),
|
|
(
|
|
"slogan",
|
|
models.CharField(
|
|
blank=True, max_length=512, null=True, verbose_name="slogan"
|
|
),
|
|
),
|
|
(
|
|
"description",
|
|
models.TextField(blank=True, null=True, verbose_name="description"),
|
|
),
|
|
(
|
|
"thumbnail",
|
|
models.ImageField(
|
|
blank=True,
|
|
null=True,
|
|
upload_to="video/playlist/thumbnails/",
|
|
verbose_name="thumbnail",
|
|
),
|
|
),
|
|
("order", models.PositiveIntegerField(default=0, verbose_name="order")),
|
|
("status", models.BooleanField(default=True, verbose_name="status")),
|
|
(
|
|
"view_count",
|
|
models.PositiveBigIntegerField(
|
|
default=0, verbose_name="view count"
|
|
),
|
|
),
|
|
(
|
|
"total_time",
|
|
models.DurationField(
|
|
blank=True, null=True, verbose_name="total time"
|
|
),
|
|
),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
(
|
|
"categories",
|
|
models.ManyToManyField(
|
|
blank=True,
|
|
related_name="playlists",
|
|
to="video.videocategory",
|
|
verbose_name="categories",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Video Playlist",
|
|
"verbose_name_plural": "Video Playlists",
|
|
"ordering": ["order", "-created_at"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="VideoPlaylistInCollection",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("order", models.PositiveIntegerField(default=0, verbose_name="order")),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
(
|
|
"collection",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="collection_playlists",
|
|
to="video.videocollection",
|
|
verbose_name="collection",
|
|
),
|
|
),
|
|
(
|
|
"playlist",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="playlist_collections",
|
|
to="video.videoplaylist",
|
|
verbose_name="playlist",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Video Playlist in Collection",
|
|
"verbose_name_plural": "Video Playlists in Collections",
|
|
"ordering": ["order"],
|
|
"unique_together": {("collection", "playlist")},
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name="videoplaylist",
|
|
name="collections",
|
|
field=models.ManyToManyField(
|
|
blank=True,
|
|
related_name="related_playlists",
|
|
through="video.VideoPlaylistInCollection",
|
|
to="video.videocollection",
|
|
verbose_name="collections",
|
|
),
|
|
),
|
|
migrations.CreateModel(
|
|
name="MiddleVideoCollection",
|
|
fields=[],
|
|
options={
|
|
"verbose_name": "Middle Section Video Collection",
|
|
"verbose_name_plural": "Middle Section Video Collections",
|
|
"proxy": True,
|
|
"indexes": [],
|
|
"constraints": [],
|
|
},
|
|
bases=("video.videocollection",),
|
|
),
|
|
migrations.CreateModel(
|
|
name="PinnedVideoCollection",
|
|
fields=[],
|
|
options={
|
|
"verbose_name": "Pinned Video Collection",
|
|
"verbose_name_plural": "Pinned Video Collections",
|
|
"proxy": True,
|
|
"indexes": [],
|
|
"constraints": [],
|
|
},
|
|
bases=("video.videocollection",),
|
|
),
|
|
migrations.CreateModel(
|
|
name="PlaylistItem",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"priority",
|
|
models.PositiveIntegerField(default=0, verbose_name="priority"),
|
|
),
|
|
(
|
|
"created_at",
|
|
models.DateTimeField(auto_now_add=True, verbose_name="created at"),
|
|
),
|
|
(
|
|
"updated_at",
|
|
models.DateTimeField(auto_now=True, verbose_name="updated at"),
|
|
),
|
|
(
|
|
"playlist",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="playlist_items",
|
|
to="video.videoplaylist",
|
|
verbose_name="playlist",
|
|
),
|
|
),
|
|
(
|
|
"video",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="playlist_appearances",
|
|
to="video.video",
|
|
verbose_name="video",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Playlist Item",
|
|
"verbose_name_plural": "Playlist Items",
|
|
"ordering": ["priority"],
|
|
"unique_together": {("playlist", "video")},
|
|
},
|
|
),
|
|
]
|