Allow items to have multiple uploads linked

This commit is contained in:
ekzyis 2023-10-20 02:04:50 +02:00
parent 51bc4b82d0
commit ef0506d7c6
2 changed files with 10 additions and 2 deletions

View File

@ -0,0 +1,8 @@
/*
Warnings:
- You are about to drop the column `uploadId` on the `Item` table. All the data in the column will be lost.
*/
-- DropIndex
DROP INDEX "Upload.itemId_unique";

View File

@ -176,7 +176,7 @@ model Upload {
size Int size Int
width Int? width Int?
height Int? height Int?
itemId Int? @unique(map: "Upload.itemId_unique") itemId Int?
userId Int userId Int
item Item? @relation(fields: [itemId], references: [id]) item Item? @relation(fields: [itemId], references: [id])
user User @relation("Uploads", fields: [userId], references: [id], onDelete: Cascade) user User @relation("Uploads", fields: [userId], references: [id], onDelete: Cascade)
@ -299,7 +299,7 @@ model Item {
PollOption PollOption[] PollOption PollOption[]
PollVote PollVote[] PollVote PollVote[]
ThreadSubscription ThreadSubscription[] ThreadSubscription ThreadSubscription[]
upload Upload? uploads Upload[]
User User[] User User[]
itemForwards ItemForward[] itemForwards ItemForward[]