ekzyis 900592020f Add Upload.paid boolean column
One item can have multiple images linked to it, but an image can also be used in multiple items (many-to-many relation).

Since we don't really care to which item an image is linked and vice versa, we just use a boolean column to mark if an image was already paid for.

This makes fee calculation easier since no JOINs are required.
2023-11-02 01:48:34 +01:00

19 lines
393 B
SQL

/*
Warnings:
- You are about to drop the column `itemId` on the `Upload` table. All the data in the column will be lost.
*/
-- DropForeignKey
ALTER TABLE "Upload" DROP CONSTRAINT "Upload_itemId_fkey";
-- DropIndex
DROP INDEX "Upload.itemId_index";
-- DropIndex
DROP INDEX "Upload.itemId_unique";
-- AlterTable
ALTER TABLE "Upload" DROP COLUMN "itemId",
ADD COLUMN "paid" BOOLEAN;