/* eslint-disable no-console */ /** * Seeds the Feed table with the starter Canadian news feeds. * * npm run db:seed * (also auto-invoked by `prisma migrate dev` via the "prisma.seed" hook.) * * Idempotent: existing feeds (matched by URL) are left untouched, new * starter feeds are added. User-added feeds are never modified. * * tsx reads tsconfig.json paths, so the "@/..." aliases resolve. */ import { PrismaClient } from '@prisma/client'; import { seedFeedsIfEmpty } from '../src/lib/ingest/seed'; async function main() { const prisma = new PrismaClient(); try { const before = await prisma.feed.count(); const { created, total } = await seedFeedsIfEmpty(); console.log(`[seed] feeds: ${before} -> ${total} (${created} created)`); } finally { await prisma.$disconnect(); } } main().catch((e) => { console.error(e); process.exit(1); });