comment field removed from wishlist items

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-06 18:11:50 +01:00
parent b653faceac
commit fb4842d007
7 changed files with 23 additions and 7 deletions

View file

@ -0,0 +1,23 @@
/*
Warnings:
- You are about to drop the column `comment` on the `Item` table. All the data in the column will be lost.
*/
-- RedefineTables
PRAGMA foreign_keys=OFF;
CREATE TABLE "new_Item" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"title" TEXT NOT NULL,
"url" TEXT NOT NULL DEFAULT '',
"imageSrc" TEXT NOT NULL DEFAULT '',
"description" TEXT NOT NULL,
"bought" BOOLEAN NOT NULL DEFAULT false,
"wishlistId" TEXT NOT NULL,
CONSTRAINT "Item_wishlistId_fkey" FOREIGN KEY ("wishlistId") REFERENCES "Wishlist" ("id") ON DELETE RESTRICT ON UPDATE CASCADE
);
INSERT INTO "new_Item" ("bought", "description", "id", "imageSrc", "title", "url", "wishlistId") SELECT "bought", "description", "id", "imageSrc", "title", "url", "wishlistId" FROM "Item";
DROP TABLE "Item";
ALTER TABLE "new_Item" RENAME TO "Item";
PRAGMA foreign_key_check;
PRAGMA foreign_keys=ON;

View file

@ -25,7 +25,6 @@ model Item {
url String @default("")
imageSrc String @default("")
description String
comment String @default("")
bought Boolean @default(false)
wishlist Wishlist @relation(fields: [wishlistId], references: [id])
wishlistId String

View file

@ -18,7 +18,6 @@ const wishlistData: Prisma.WishlistCreateInput[] = [
'https://www.lego.com/cdn/cs/set/assets/blt1fc37afef51cfa9f/40442.jpg?fit=bounds&format=jpg&quality=80&width=1500&height=1500&dpr=1',
description:
'Cute goldfish and fry, build-and-display BrickHeadz™ model',
comment: '',
},
],
},

View file

@ -7,7 +7,6 @@ export const wishlistItemRequestSchema = {
url: { type: 'string' },
imageSrc: { type: 'string' },
description: { type: 'string' },
comment: { type: 'string' },
bought: { type: 'boolean' },
},
}
@ -20,7 +19,6 @@ export const wishlistItemResponseSchema = {
url: { type: 'string' },
imageSrc: { type: 'string' },
description: { type: 'string', maxLength: 300 },
comment: { type: 'string' },
bought: { type: 'boolean' },
wishlistId: { type: 'string' },
},

View file

@ -9,7 +9,6 @@ defineProps<{
image: string
url?: string
description: string
comment?: string
}>()
const { t } = useI18n()
</script>

View file

@ -4,7 +4,6 @@ export interface WishlistItem {
url: string
imageSrc: string
description: string
comment: string
bought: boolean
wishlistId: boolean
}

View file

@ -58,7 +58,6 @@ const bought = async (item: WishlistItemType): Promise<void> => {
:url="item.url"
:image="item.imageSrc"
:description="item.description"
:comment="item.comment"
@bought="bought(item)"
/>
</div>