import {PageParams} from "@/types/next"; import {Page, PageContent, PageHeader, PageTitle} from "@/features/layout/page"; import {notFound} from "next/navigation"; import {getOrganization} from "@/lib/auth/auth"; import {Metadata} from "next"; import {db} from "@/db"; import {MigrationTool} from "@/components/wrappers/dashboard/organization/migration/migration-tool"; export const metadata: Metadata = { title: "Projects", }; export default async function RoutePage(props: PageParams<{}>) { const organization = await getOrganization({}); if (!organization) { notFound(); } const projects = await db.query.project.findMany({ where: (project, {eq, and, not}) => and( eq(project.organizationId, organization.id), not(eq(project.isArchived, true)) ), with: { organization: true, databases: { where: (database, { isNull, not, inArray, and }) => and( isNull(database.deletedAt), not(inArray(database.dbms, ["valkey", "redis"])) ), with: { backups: { where: (backup, { isNull, eq, and }) => and( isNull(backup.deletedAt), eq(backup.status, "success") ), orderBy: (backup, {desc}) => [desc(backup.createdAt)], limit: 15, } } }, }, }); return ( Database Migration

Import backups from a source project into your target database

); }