feat(media): complete mvp1 media foundation workflows
This commit is contained in:
@@ -13,6 +13,75 @@ async function main() {
|
||||
},
|
||||
})
|
||||
|
||||
const media = await db.mediaAsset.upsert({
|
||||
where: { storageKey: "seed/artwork-welcome.jpg" },
|
||||
update: {},
|
||||
create: {
|
||||
type: "artwork",
|
||||
title: "Seed Artwork Image",
|
||||
altText: "Seed artwork placeholder",
|
||||
tags: ["seed", "portfolio"],
|
||||
storageKey: "seed/artwork-welcome.jpg",
|
||||
mimeType: "image/jpeg",
|
||||
isPublished: true,
|
||||
},
|
||||
})
|
||||
|
||||
const artwork = await db.artwork.upsert({
|
||||
where: { slug: "seed-artwork-welcome" },
|
||||
update: {},
|
||||
create: {
|
||||
title: "Seed Artwork",
|
||||
slug: "seed-artwork-welcome",
|
||||
description: "Baseline seeded artwork for MVP1 media foundation.",
|
||||
medium: "Digital",
|
||||
year: 2026,
|
||||
availability: "available",
|
||||
isPublished: true,
|
||||
},
|
||||
})
|
||||
|
||||
const gallery = await db.gallery.upsert({
|
||||
where: { slug: "featured" },
|
||||
update: {},
|
||||
create: {
|
||||
name: "Featured",
|
||||
slug: "featured",
|
||||
description: "Featured artwork selection.",
|
||||
isVisible: true,
|
||||
},
|
||||
})
|
||||
|
||||
await db.artworkGallery.upsert({
|
||||
where: {
|
||||
artworkId_galleryId: {
|
||||
artworkId: artwork.id,
|
||||
galleryId: gallery.id,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
artworkId: artwork.id,
|
||||
galleryId: gallery.id,
|
||||
},
|
||||
update: {},
|
||||
})
|
||||
|
||||
await db.artworkRendition.upsert({
|
||||
where: {
|
||||
artworkId_slot: {
|
||||
artworkId: artwork.id,
|
||||
slot: "thumbnail",
|
||||
},
|
||||
},
|
||||
create: {
|
||||
artworkId: artwork.id,
|
||||
mediaAssetId: media.id,
|
||||
slot: "thumbnail",
|
||||
isPrimary: true,
|
||||
},
|
||||
update: {},
|
||||
})
|
||||
|
||||
await db.systemSetting.upsert({
|
||||
where: { key: "public.header_banner" },
|
||||
update: {},
|
||||
|
||||
Reference in New Issue
Block a user