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.
436 lines
16 KiB
436 lines
16 KiB
# Generated by Django 4.2.27 on 2026-01-22 10:48
|
|
|
|
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="PodcastCategory",
|
|
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": "Podcast Category",
|
|
"verbose_name_plural": "Podcast Categories",
|
|
"ordering": ["order"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PodcastCollection",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
(
|
|
"title",
|
|
models.CharField(
|
|
help_text="This title will not be displayed anywhere",
|
|
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="podcast/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": "Podcast Collection",
|
|
"verbose_name_plural": "Podcasts Collections",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PodcastPlaylist",
|
|
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="podcast/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="podcast.podcastcategory",
|
|
verbose_name="categories",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Podcast Playlist",
|
|
"verbose_name_plural": "Podcast Playlists",
|
|
"ordering": ["order", "-created_at"],
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="PodcastPlaylistInCollection",
|
|
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="podcast.podcastcollection",
|
|
verbose_name="collection",
|
|
),
|
|
),
|
|
(
|
|
"playlist",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="playlist_collections",
|
|
to="podcast.podcastplaylist",
|
|
verbose_name="playlist",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Podcast Playlist in Collection",
|
|
"verbose_name_plural": "Podcast Playlists in Collections",
|
|
"ordering": ["order"],
|
|
"unique_together": {("collection", "playlist")},
|
|
},
|
|
),
|
|
migrations.AddField(
|
|
model_name="podcastplaylist",
|
|
name="collections",
|
|
field=models.ManyToManyField(
|
|
blank=True,
|
|
related_name="related_playlists",
|
|
through="podcast.PodcastPlaylistInCollection",
|
|
to="podcast.podcastcollection",
|
|
verbose_name="collections",
|
|
),
|
|
),
|
|
migrations.CreateModel(
|
|
name="Podcast",
|
|
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="podcast_thumbnails/",
|
|
),
|
|
),
|
|
("description", models.TextField(null=True)),
|
|
(
|
|
"audio_file",
|
|
models.FileField(blank=True, null=True, upload_to="podcast/audio/"),
|
|
),
|
|
("audio_time", models.TimeField()),
|
|
(
|
|
"view_count",
|
|
models.PositiveBigIntegerField(
|
|
default=0, verbose_name="view count"
|
|
),
|
|
),
|
|
(
|
|
"download_count",
|
|
models.PositiveBigIntegerField(
|
|
default=0, verbose_name="download_count 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"),
|
|
),
|
|
(
|
|
"categories",
|
|
models.ManyToManyField(
|
|
blank=True,
|
|
related_name="podcasts",
|
|
to="podcast.podcastcategory",
|
|
verbose_name="categories",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Podcast",
|
|
"verbose_name_plural": "Podcasts",
|
|
},
|
|
),
|
|
migrations.CreateModel(
|
|
name="MiddlePodcastCollection",
|
|
fields=[],
|
|
options={
|
|
"verbose_name": "Regular Collection (Middle Section)",
|
|
"verbose_name_plural": "Regular Collections (Middle Section)",
|
|
"proxy": True,
|
|
"indexes": [],
|
|
"constraints": [],
|
|
},
|
|
bases=("podcast.podcastcollection",),
|
|
),
|
|
migrations.CreateModel(
|
|
name="PinnedPodcastCollection",
|
|
fields=[],
|
|
options={
|
|
"verbose_name": "Pinned Collection (Top Section)",
|
|
"verbose_name_plural": "Pinned Collections (Top Section)",
|
|
"proxy": True,
|
|
"indexes": [],
|
|
"constraints": [],
|
|
},
|
|
bases=("podcast.podcastcollection",),
|
|
),
|
|
migrations.CreateModel(
|
|
name="UserPlaylist",
|
|
fields=[
|
|
(
|
|
"id",
|
|
models.BigAutoField(
|
|
auto_created=True,
|
|
primary_key=True,
|
|
serialize=False,
|
|
verbose_name="ID",
|
|
),
|
|
),
|
|
("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"),
|
|
),
|
|
(
|
|
"podcast",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="user_playlists",
|
|
to="podcast.podcast",
|
|
verbose_name="podcast",
|
|
),
|
|
),
|
|
(
|
|
"user",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="podcast_playlists",
|
|
to=settings.AUTH_USER_MODEL,
|
|
verbose_name="user",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "User Playlist",
|
|
"verbose_name_plural": "User Playlists",
|
|
"unique_together": {("user", "podcast")},
|
|
},
|
|
),
|
|
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="podcast.podcastplaylist",
|
|
verbose_name="playlist",
|
|
),
|
|
),
|
|
(
|
|
"podcast",
|
|
models.ForeignKey(
|
|
on_delete=django.db.models.deletion.CASCADE,
|
|
related_name="playlist_appearances",
|
|
to="podcast.podcast",
|
|
verbose_name="podcast",
|
|
),
|
|
),
|
|
],
|
|
options={
|
|
"verbose_name": "Playlist Item",
|
|
"verbose_name_plural": "Playlist Items",
|
|
"ordering": ["priority"],
|
|
"unique_together": {("playlist", "podcast")},
|
|
},
|
|
),
|
|
]
|