chore: remove cloud storage remainings (#1934)
This commit is contained in:
parent
0e6b0da142
commit
703a8e5856
33 changed files with 50 additions and 3571 deletions
39
api/libretime_api/legacy/migrations/0034_3_0_0_alpha_13_8.py
Normal file
39
api/libretime_api/legacy/migrations/0034_3_0_0_alpha_13_8.py
Normal file
|
@ -0,0 +1,39 @@
|
|||
# pylint: disable=invalid-name
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
from ._migrations import legacy_migration_factory
|
||||
|
||||
UP = """
|
||||
DROP TABLE IF EXISTS "cloud_file" CASCADE;
|
||||
"""
|
||||
|
||||
DOWN = """
|
||||
CREATE TABLE "cloud_file"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"storage_backend" VARCHAR(512) NOT NULL,
|
||||
"resource_id" TEXT NOT NULL,
|
||||
"cc_file_id" INTEGER,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
ALTER TABLE "cloud_file" ADD CONSTRAINT "cloud_file_FK_1"
|
||||
FOREIGN KEY ("cc_file_id")
|
||||
REFERENCES "cc_files" ("id")
|
||||
ON DELETE CASCADE;
|
||||
"""
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
dependencies = [
|
||||
("legacy", "0033_3_0_0_alpha_13_7"),
|
||||
]
|
||||
operations = [
|
||||
migrations.RunPython(
|
||||
code=legacy_migration_factory(
|
||||
target="3.0.0-alpha.13.8",
|
||||
sql=UP,
|
||||
)
|
||||
)
|
||||
]
|
|
@ -1 +1 @@
|
|||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.7"
|
||||
LEGACY_SCHEMA_VERSION = "3.0.0-alpha.13.8"
|
||||
|
|
|
@ -100,21 +100,6 @@ CREATE TABLE "cc_track_types"
|
|||
CONSTRAINT "cc_track_types_code_idx" UNIQUE ("code")
|
||||
);
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- cloud_file
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
DROP TABLE IF EXISTS "cloud_file" CASCADE;
|
||||
|
||||
CREATE TABLE "cloud_file"
|
||||
(
|
||||
"id" serial NOT NULL,
|
||||
"storage_backend" VARCHAR(512) NOT NULL,
|
||||
"resource_id" TEXT NOT NULL,
|
||||
"cc_file_id" INTEGER,
|
||||
PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
-- cc_show
|
||||
-----------------------------------------------------------------------
|
||||
|
@ -735,11 +720,6 @@ ALTER TABLE "cc_files" ADD CONSTRAINT "cc_files_editedby_fkey"
|
|||
FOREIGN KEY ("editedby")
|
||||
REFERENCES "cc_subjs" ("id");
|
||||
|
||||
ALTER TABLE "cloud_file" ADD CONSTRAINT "cloud_file_FK_1"
|
||||
FOREIGN KEY ("cc_file_id")
|
||||
REFERENCES "cc_files" ("id")
|
||||
ON DELETE CASCADE;
|
||||
|
||||
ALTER TABLE "cc_show" ADD CONSTRAINT "cc_playlist_autoplaylist_fkey"
|
||||
FOREIGN KEY ("autoplaylist_id")
|
||||
REFERENCES "cc_playlist" ("id")
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
from .cloud_file import CloudFile
|
||||
from .file import File
|
||||
from .library import Library
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
from django.db import models
|
||||
|
||||
|
||||
class CloudFile(models.Model):
|
||||
storage_backend = models.CharField(max_length=512)
|
||||
resource_id = models.TextField()
|
||||
filename = models.ForeignKey(
|
||||
"storage.File",
|
||||
on_delete=models.DO_NOTHING,
|
||||
blank=True,
|
||||
null=True,
|
||||
db_column="cc_file_id",
|
||||
)
|
||||
|
||||
class Meta:
|
||||
managed = False
|
||||
db_table = "cloud_file"
|
|
@ -1,8 +1,7 @@
|
|||
from rest_framework import routers
|
||||
|
||||
from .views import CloudFileViewSet, FileViewSet, LibraryViewSet
|
||||
from .views import FileViewSet, LibraryViewSet
|
||||
|
||||
router = routers.DefaultRouter()
|
||||
router.register("files", FileViewSet)
|
||||
router.register("cloud-files", CloudFileViewSet)
|
||||
router.register("libraries", LibraryViewSet)
|
||||
|
|
|
@ -1,3 +1,2 @@
|
|||
from .cloud_file import CloudFileSerializer
|
||||
from .file import FileSerializer
|
||||
from .library import LibrarySerializer
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
from rest_framework import serializers
|
||||
|
||||
from ..models import CloudFile
|
||||
|
||||
|
||||
class CloudFileSerializer(serializers.HyperlinkedModelSerializer):
|
||||
class Meta:
|
||||
model = CloudFile
|
||||
fields = "__all__"
|
|
@ -1,3 +1,2 @@
|
|||
from .cloud_file import CloudFileViewSet
|
||||
from .file import FileViewSet
|
||||
from .library import LibraryViewSet
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
from rest_framework import viewsets
|
||||
|
||||
from ..models import CloudFile
|
||||
from ..serializers import CloudFileSerializer
|
||||
|
||||
|
||||
class CloudFileViewSet(viewsets.ModelViewSet):
|
||||
queryset = CloudFile.objects.all()
|
||||
serializer_class = CloudFileSerializer
|
||||
model_permission_name = "cloudfile"
|
Loading…
Add table
Add a link
Reference in a new issue