This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
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();
|
||||
});
|
||||
Reference in New Issue
Block a user