boring.tools-poc/packages/database/src/migration.ts
Lars Hampe 30f79fc6c3
All checks were successful
Build and Push Docker Image / tests (push) Successful in 36s
Build and Push Docker Image / build (push) Successful in 53s
feat: fix migrations logging
2024-10-02 22:03:44 +02:00

13 lines
349 B
TypeScript

import { logger } from '@boring.tools/logger'
import { migrate } from 'drizzle-orm/postgres-js/migrator'
import { db } from './'
export const migrateDatabase = async (dir: string) => {
try {
await migrate(db, { migrationsFolder: dir })
logger.info('Migrations: Ok')
} catch (error) {
logger.error('Migrations: Failed', error)
}
}