This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { query } from './db'; | |
| import { logger } from './logger'; | |
| /** | |
| * Runs idempotent migrations on startup. | |
| * Safe to execute on every boot — all statements use IF NOT EXISTS / IF EXISTS. | |
| */ | |
| export async function runStartupMigrations(): Promise<void> { | |
| logger.info('Running startup migrations...'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| export interface User { | |
| id: string; | |
| email: string; | |
| name: string; | |
| avatar_url: string | null; | |
| provider: 'github' | 'google' | 'okta' | 'apple' | 'internal'; | |
| provider_id: string; | |
| organization_id: string | null; | |
| created_at: Date; | |
| last_login: Date | null; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/backend/src/db.ts b/backend/src/db.ts | |
| index bc067d8..9fa21e9 100644 | |
| --- a/backend/src/db.ts | |
| +++ b/backend/src/db.ts | |
| @@ -6,7 +6,7 @@ const pool = new Pool({ | |
| connectionString: process.env.DATABASE_URL, | |
| max: 20, | |
| idleTimeoutMillis: 30000, | |
| - connectionTimeoutMillis: 2000, | |
| + connectionTimeoutMillis: 10000, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/backend/src/routes/auth.ts b/backend/src/routes/auth.ts | |
| index 2aef333..51bdb83 100644 | |
| --- a/backend/src/routes/auth.ts | |
| +++ b/backend/src/routes/auth.ts | |
| @@ -369,17 +369,8 @@ router.post( | |
| router.get('/user', authenticate, async (req, res) => { | |
| const authReq = req as unknown as AuthenticatedRequest; | |
| - // Check if user is a platform admin | |
| - let is_platform_admin = false; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/backend/src/db.ts b/backend/src/db.ts | |
| index bc067d8..9fa21e9 100644 | |
| --- a/backend/src/db.ts | |
| +++ b/backend/src/db.ts | |
| @@ -6,7 +6,7 @@ const pool = new Pool({ | |
| connectionString: process.env.DATABASE_URL, | |
| max: 20, | |
| idleTimeoutMillis: 30000, | |
| - connectionTimeoutMillis: 2000, | |
| + connectionTimeoutMillis: 10000, |