29 lines
738 B
TypeScript
29 lines
738 B
TypeScript
/**
|
|
* Writes the adopted team Rule, including its document, before the server
|
|
* listens. Container start runs the esbuild bundle of this file.
|
|
*
|
|
* Local:
|
|
* node --env-file=.env --import tsx scripts/seed-team-rule.ts
|
|
*/
|
|
import { PrismaClient } from "@prisma/client";
|
|
import { seedTeamRule } from "../prisma/seed/teamRule";
|
|
|
|
const prisma = new PrismaClient();
|
|
|
|
async function main() {
|
|
const result = await seedTeamRule(prisma);
|
|
// eslint-disable-next-line no-console -- boot CLI feedback
|
|
console.log(
|
|
`Seeded team Rule: ${result.action} ${result.title} (${result.id})`,
|
|
);
|
|
}
|
|
|
|
main()
|
|
.catch((error) => {
|
|
console.error(error);
|
|
process.exit(1);
|
|
})
|
|
.finally(async () => {
|
|
await prisma.$disconnect();
|
|
});
|