mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Set many album artists
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
/*
|
||||||
|
Warnings:
|
||||||
|
|
||||||
|
- You are about to drop the column `albumArtistId` on the `Album` table. All the data in the column will be lost.
|
||||||
|
|
||||||
|
*/
|
||||||
|
-- DropForeignKey
|
||||||
|
ALTER TABLE "Album" DROP CONSTRAINT "Album_albumArtistId_fkey";
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Album" DROP COLUMN "albumArtistId";
|
||||||
|
|
||||||
|
-- AlterTable
|
||||||
|
ALTER TABLE "Song" ADD COLUMN "albumArtistId" UUID;
|
||||||
|
|
||||||
|
-- CreateTable
|
||||||
|
CREATE TABLE "_AlbumToAlbumArtist" (
|
||||||
|
"A" UUID NOT NULL,
|
||||||
|
"B" UUID NOT NULL
|
||||||
|
);
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE UNIQUE INDEX "_AlbumToAlbumArtist_AB_unique" ON "_AlbumToAlbumArtist"("A", "B");
|
||||||
|
|
||||||
|
-- CreateIndex
|
||||||
|
CREATE INDEX "_AlbumToAlbumArtist_B_index" ON "_AlbumToAlbumArtist"("B");
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "Song" ADD CONSTRAINT "Song_albumArtistId_fkey" FOREIGN KEY ("albumArtistId") REFERENCES "AlbumArtist"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "_AlbumToAlbumArtist" ADD CONSTRAINT "_AlbumToAlbumArtist_A_fkey" FOREIGN KEY ("A") REFERENCES "Album"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
|
|
||||||
|
-- AddForeignKey
|
||||||
|
ALTER TABLE "_AlbumToAlbumArtist" ADD CONSTRAINT "_AlbumToAlbumArtist_B_fkey" FOREIGN KEY ("B") REFERENCES "AlbumArtist"("id") ON DELETE CASCADE ON UPDATE CASCADE;
|
||||||
@@ -320,6 +320,7 @@ model AlbumArtist {
|
|||||||
ratings AlbumArtistRating[]
|
ratings AlbumArtistRating[]
|
||||||
images Image[]
|
images Image[]
|
||||||
favorites Favorite[]
|
favorites Favorite[]
|
||||||
|
songs Song[]
|
||||||
|
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
serverId String @db.Uuid
|
serverId String @db.Uuid
|
||||||
@@ -342,15 +343,13 @@ model Album {
|
|||||||
songs Song[]
|
songs Song[]
|
||||||
genres Genre[]
|
genres Genre[]
|
||||||
artists Artist[]
|
artists Artist[]
|
||||||
|
albumArtists AlbumArtist[]
|
||||||
externals External[]
|
externals External[]
|
||||||
serverFolders ServerFolder[]
|
serverFolders ServerFolder[]
|
||||||
ratings AlbumRating[]
|
ratings AlbumRating[]
|
||||||
images Image[]
|
images Image[]
|
||||||
favorites Favorite[]
|
favorites Favorite[]
|
||||||
|
|
||||||
albumArtist AlbumArtist? @relation(fields: [albumArtistId], references: [id])
|
|
||||||
albumArtistId String? @db.Uuid
|
|
||||||
|
|
||||||
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
server Server @relation(fields: [serverId], references: [id], onDelete: Cascade)
|
||||||
serverId String @db.Uuid
|
serverId String @db.Uuid
|
||||||
|
|
||||||
@@ -413,6 +412,9 @@ model Song {
|
|||||||
images Image[]
|
images Image[]
|
||||||
favorites Favorite[]
|
favorites Favorite[]
|
||||||
|
|
||||||
|
albumArtist AlbumArtist? @relation(fields: [albumArtistId], references: [id])
|
||||||
|
albumArtistId String? @db.Uuid
|
||||||
|
|
||||||
album Album? @relation(fields: [albumId], references: [id])
|
album Album? @relation(fields: [albumId], references: [id])
|
||||||
albumId String? @db.Uuid
|
albumId String? @db.Uuid
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user