Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo. Co-authored-by: Cursor <cursoragent@cursor.com>
30 lines
873 B
TypeScript
30 lines
873 B
TypeScript
/**
|
|
* Prisma seed: upsert the 11 educational course sessions.
|
|
*
|
|
* Run: npm run prisma:seed
|
|
* (also invoked by `prisma migrate reset` when configured)
|
|
*/
|
|
import { seedCourseSessions } from '../src/modules/sessions/sessions.service.js';
|
|
import { PROGRAM_SESSION_COUNT } from '../src/modules/sessions/catalog.js';
|
|
import { disconnectPrisma, prisma } from '../src/lib/prisma.js';
|
|
|
|
async function main() {
|
|
await seedCourseSessions();
|
|
const count = await prisma.courseSession.count();
|
|
if (count < PROGRAM_SESSION_COUNT) {
|
|
throw new Error(
|
|
`Expected at least ${PROGRAM_SESSION_COUNT} course sessions after seed, found ${count}`,
|
|
);
|
|
}
|
|
console.log(`Seeded ${count} course sessions`);
|
|
}
|
|
|
|
main()
|
|
.catch((err) => {
|
|
console.error('Prisma seed failed:', err);
|
|
process.exitCode = 1;
|
|
})
|
|
.finally(async () => {
|
|
await disconnectPrisma();
|
|
});
|