| 395 | // --------------------------------------------------------------------------- |
| 396 | |
| 397 | export async function setupPostgresFixtures( |
| 398 | projectId: string, |
| 399 | orgId: string |
| 400 | ): Promise<void> { |
| 401 | const db = getDb(); |
| 402 | try { |
| 403 | await db.organization.upsert({ |
| 404 | where: { id: orgId }, |
| 405 | create: { id: orgId, name: 'Test Org', timezone: 'UTC' }, |
| 406 | update: { timezone: 'UTC' }, |
| 407 | }); |
| 408 | await db.project.upsert({ |
| 409 | where: { id: projectId }, |
| 410 | create: { id: projectId, name: 'Test Project', organizationId: orgId }, |
| 411 | update: {}, |
| 412 | }); |
| 413 | } finally { |
| 414 | await db.$disconnect(); |
| 415 | } |
| 416 | } |
| 417 | |
| 418 | export async function teardownPostgresFixtures( |
| 419 | projectId: string, |