Ship Novya PWA with backend for deployable production use.
Fix production TypeScript builds and add DEPLOY.md so the app can be hosted from this repo. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
/**
|
||||
* 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();
|
||||
});
|
||||
Reference in New Issue
Block a user