43 lines
897 B
JavaScript
43 lines
897 B
JavaScript
const { PrismaClient } = require("@prisma/client");
|
|
const prisma = new PrismaClient();
|
|
|
|
const commonTasks = [
|
|
"Oil change",
|
|
"Oil filter replacement",
|
|
"Air filter replacement",
|
|
"Cabin filter replacement",
|
|
"Front brake pads replacement",
|
|
"Rear brake pads replacement",
|
|
"Brake fluid change",
|
|
"Tyre rotation",
|
|
"Wheel alignment",
|
|
"Battery test",
|
|
"Coolant change",
|
|
"Timing belt inspection",
|
|
"Spark plug replacement",
|
|
"Full diagnostic scan",
|
|
"Suspension check",
|
|
"Exhaust inspection",
|
|
"NCT pre-check",
|
|
];
|
|
|
|
async function main() {
|
|
for (const title of commonTasks) {
|
|
await prisma.quickTask.upsert({
|
|
where: { title },
|
|
update: {},
|
|
create: { title, useCount: 1 },
|
|
});
|
|
}
|
|
console.log("Seeded quick tasks");
|
|
}
|
|
|
|
main()
|
|
.catch((e) => {
|
|
console.error(e);
|
|
process.exit(1);
|
|
})
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|