refactor(db): migrate app pages and APIs from Prisma facade to Drizzle

Co-authored-by: Cursor <[email protected]>
This commit is contained in:
SimoandCursor committed 2026-08-01 14:15:12 +02:00
1 parent 53b350057d
commit 7c39aef5d9
40 files changed
+1124 -692

No files matched your search

+13 -13
View File
@@ -1,27 +1,27 @@
import { desc, eq } from "drizzle-orm";
import Link from "next/link";
import { getTranslations } from "next-intl/server";
import { ContentCard, EmptyState } from "@/components/public/ui";
import { db, RadioContests } from "@/lib/db";
import { formatDate } from "@/lib/format-date";
import { prisma } from "@/lib/prisma";
export const revalidate = 300;
export default async function RadioContestsPage() {
const t = await getTranslations("pages.radioContests");
const contests = await prisma.radioContests
.findMany({
where: { isActive: true },
orderBy: { startDate: "desc" },
take: 50,
select: {
id: true,
title: true,
prize: true,
startDate: true,
endDate: true,
},
const contests = await db
.select({
id: RadioContests.id,
title: RadioContests.title,
prize: RadioContests.prize,
startDate: RadioContests.startDate,
endDate: RadioContests.endDate,
})
.from(RadioContests)
.where(eq(RadioContests.isActive, true))
.orderBy(desc(RadioContests.startDate))
.limit(50)
.catch(() => []);
return (