119 lines
4.1 KiB
TypeScript
119 lines
4.1 KiB
TypeScript
import { PrismaClient } from "@prisma/client";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
const mangaData = [
|
|
{
|
|
title: "Vice Versa",
|
|
slug: "vice-versa",
|
|
description:
|
|
"A tale of fate and desire intertwined. When two souls swap destinies, they discover the true meaning of living someone else's life.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20260129_96/1769683677999mNYO7_PNG/84__Thumb_Poster.png?type=q90",
|
|
genre: "Romance",
|
|
},
|
|
{
|
|
title: "Became a Sales Genius",
|
|
slug: "became-a-sales-genius",
|
|
description:
|
|
"Reborn with memories of his past life, a failed salesman returns to dominate the corporate world with knowledge no one else possesses.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20251105_137/1762317547495MfzIC_JPEG/Thumb_Poster.jpg?type=q90",
|
|
genre: "Drama",
|
|
},
|
|
{
|
|
title: "A Regressor's Tale of Cultivation",
|
|
slug: "regressors-tale-of-cultivation",
|
|
description:
|
|
"After countless regressions, a martial artist finally begins to unravel the deepest mysteries of cultivation and the heavenly dao.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20251114_103/1763091301425CY14H_JPEG/Thumb_Poster.jpg?type=q90",
|
|
genre: "Martial Arts",
|
|
},
|
|
{
|
|
title: "My Avatar's Path to Greatness",
|
|
slug: "my-avatars-path-to-greatness",
|
|
description:
|
|
"By splitting himself into multiple clones, one man sets out to conquer every path of power simultaneously.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250425_176/1745558711155VySyE_JPEG/Thumb_Poster_7727.jpg?type=q90",
|
|
genre: "Fantasy",
|
|
},
|
|
{
|
|
title: "Sera",
|
|
slug: "sera",
|
|
description:
|
|
"The explosive school life of Gu Sera, a girl whose temper is as fierce as her sense of justice.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250321_24/1742528056930xEbcJ_JPEG/Thumb_Poster.jpg?type=q90",
|
|
genre: "School",
|
|
},
|
|
{
|
|
title: "Revenge of the Real One",
|
|
slug: "revenge-of-the-real-one",
|
|
description:
|
|
"She was the true heiress all along. Now that the truth is out, it's time for the fake to pay.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250811_6/1754909221289kEXyb_PNG/480x623.png?type=q90",
|
|
genre: "Fantasy",
|
|
},
|
|
{
|
|
title: "Kindergarten for Divine Beasts",
|
|
slug: "kindergarten-for-divine-beasts",
|
|
description:
|
|
"Running a daycare is hard enough. Running one for baby dragons, phoenixes, and ancient beasts? That's another story entirely.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250613_186/1749801415006hU2Kf_JPEG/Thumb_Poster_8051.jpg?type=q90",
|
|
genre: "Fantasy",
|
|
},
|
|
{
|
|
title: "Dr. Kim of London",
|
|
slug: "dr-kim-of-london",
|
|
description:
|
|
"An Eastern medicine prodigy takes on the Western medical establishment in Victorian London.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20251016_11/1760587613431sbps4_JPEG/Thumb_Poster.jpg?type=q90",
|
|
genre: "Drama",
|
|
},
|
|
{
|
|
title: "The Returned C-Rank Tank Won't Die",
|
|
slug: "c-rank-tank-wont-die",
|
|
description:
|
|
"Everyone thought he was weak. But after returning from a dungeon break, this C-rank tank has become truly unkillable.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250625_252/1750834745151JPG3l_JPEG/Thumb_Poster_8054.jpg?type=q90",
|
|
genre: "Fantasy",
|
|
},
|
|
{
|
|
title: "Violets Blooming in Garden",
|
|
slug: "violets-blooming-in-garden",
|
|
description:
|
|
"In the imperial court's most secluded garden, a quiet noblewoman hides secrets that could topple an empire.",
|
|
coverUrl:
|
|
"https://webtoon-phinf.pstatic.net/20250709_43/1752041143942ixO3h_PNG/垂直略縮圖480x623_Logo.png?type=q90",
|
|
genre: "Romance",
|
|
},
|
|
];
|
|
|
|
async function main() {
|
|
console.log("Seeding database...");
|
|
|
|
for (const data of mangaData) {
|
|
const manga = await prisma.manga.upsert({
|
|
where: { slug: data.slug },
|
|
update: data,
|
|
create: data,
|
|
});
|
|
console.log(` Upserted: ${manga.title} (id: ${manga.id})`);
|
|
}
|
|
|
|
console.log("Seed complete.");
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(() => prisma.$disconnect());
|