import { getLogger } from '@stock-bot/logger'; import { runPostgresMigrations } from '@stock-bot/postgres'; import type { IServiceContainer } from '@stock-bot/services'; const logger = getLogger('migration-runner'); export async function runMigrations(container: IServiceContainer): Promise { if (!container.postgres) { logger.warn('PostgreSQL not available, skipping migrations'); return; } try { const applied = await runPostgresMigrations(container.postgres, { track: 'research' }); logger.info('All migrations completed successfully', { appliedCount: applied.length }); } catch (error) { logger.error('Migration failed', { error }); throw error; } }