| 1 | import db from '../src/db'; |
| 2 | |
| 3 | async function seedUsers() { |
| 4 | try { |
| 5 | await db.user.upsert({ |
| 6 | where: { |
| 7 | id: '1', |
| 8 | }, |
| 9 | create: { |
| 10 | id: '1', |
| 11 | email: 'testuser@example.com', |
| 12 | name: 'Test User 1', |
| 13 | disableDrm: false, |
| 14 | }, |
| 15 | update: {}, |
| 16 | }); |
| 17 | |
| 18 | await db.user.upsert({ |
| 19 | where: { |
| 20 | id: '2', |
| 21 | }, |
| 22 | create: { |
| 23 | id: '2', |
| 24 | email: 'testuser2@example.com', |
| 25 | name: 'Test User 2', |
| 26 | disableDrm: false, |
| 27 | }, |
| 28 | update: {}, |
| 29 | }); |
| 30 | } catch (error) { |
| 31 | console.error('Error seeding users:', error); |
| 32 | throw error; |
| 33 | } |
| 34 | } |
| 35 | |
| 36 | async function seedCourses() { |
| 37 | const courses = [ |