Skip to content

AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents

565 B
Raw Blame
import { system } from '../helper/system/system'
import { backgroundMigrationRunner } from './background-migration-runner'
import { databaseConnection } from './database-connection'
import { databaseSeeds } from './seeds'

export async function initializeDatabase({ runMigrations }: { runMigrations: boolean }): Promise<void> {
    const ds = databaseConnection()
    await ds.initialize()
    if (runMigrations) {
        await backgroundMigrationRunner.runMigrationsWithCatchup({ dataSource: ds, log: system.globalLogger() })
    }
    await databaseSeeds.run()
}