Files
andris-carservice/prisma/seed.js
T
Hermes f7a9906add
Build and publish images / docker (push) Canceled after 0s
carservice: initial commit
2026-07-20 20:51:23 +01:00

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();
});