initial
This commit is contained in:
48
api/prisma/seed.ts
Normal file
48
api/prisma/seed.ts
Normal file
@@ -0,0 +1,48 @@
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
async function main() {
|
||||
await prisma.listing.upsert({
|
||||
where: { slug: 'retail-lighting-retrofit-south-side' },
|
||||
update: {},
|
||||
create: {
|
||||
title: 'Retail Lighting Retrofit — South Side',
|
||||
slug: 'retail-lighting-retrofit-south-side',
|
||||
image: '/images/project-1.jpg',
|
||||
summary: 'LED conversion for 5,000 sq ft retail space; 35% energy savings.'
|
||||
}
|
||||
});
|
||||
await prisma.listing.upsert({
|
||||
where: { slug: 'panel-upgrade-ocean-drive' },
|
||||
update: {},
|
||||
create: {
|
||||
title: 'Residential Panel Upgrade — Ocean Drive',
|
||||
slug: 'panel-upgrade-ocean-drive',
|
||||
image: '/images/project-2.jpg',
|
||||
summary: '100A → 200A service upgrade with AFCI breakers and EV-ready outlet.'
|
||||
}
|
||||
});
|
||||
await prisma.listing.upsert({
|
||||
where: { slug: 'office-buildout-downtown' },
|
||||
update: {},
|
||||
create: {
|
||||
title: 'Office Build-Out — Downtown',
|
||||
slug: 'office-buildout-downtown',
|
||||
image: '/images/project-3.jpg',
|
||||
summary: 'Complete tenant build-out: power distribution, LED lighting, data wiring.'
|
||||
}
|
||||
});
|
||||
|
||||
await prisma.testimonial.createMany({
|
||||
data: [
|
||||
{ name: 'Maria S.', area: 'Ocean Drive', text: 'Panel upgrade done fast. No more tripping breakers!', rating: 5 },
|
||||
{ name: 'David R.', area: 'Downtown', text: 'Office build-out finished on time. Great team.', rating: 5 },
|
||||
{ name: 'Jennifer L.', area: 'Flour Bluff', text: 'Emergency repair on Sunday. Reliable service.', rating: 5 }
|
||||
],
|
||||
skipDuplicates: true
|
||||
});
|
||||
|
||||
console.log('Seed complete');
|
||||
}
|
||||
|
||||
main().finally(() => prisma.$disconnect());
|
||||
Reference in New Issue
Block a user