File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { promises } from "node:fs";
3
3
import { FileMigrationProvider , Migrator } from "kysely" ;
4
4
import { db , destroyKyselyDb , initKyselyDb } from "./database.ts" ;
5
5
6
- async function migrateToLatest ( ) {
6
+ export async function migrateToLatest ( ) {
7
7
const migrator = new Migrator ( {
8
8
db,
9
9
provider : new FileMigrationProvider ( {
Original file line number Diff line number Diff line change 1
1
import { initKyselyDb } from "./db/database.ts" ;
2
2
import api from "./api/index.ts" ;
3
+ import { migrateToLatest } from "./db/migrator.ts" ;
3
4
4
5
initKyselyDb ( ) ;
5
6
7
+ console . info ( "Migrating database to latest version..." ) ;
8
+ await migrateToLatest ( ) ;
9
+ console . info ( "Database migrated to latest version" ) ;
10
+
11
+ console . info ( "Starting server..." ) ;
6
12
const port = 4000 ;
7
13
api . listen ( { port } ) ;
8
14
console . info ( `Server is running on port http://localhost:${ port } ` ) ;
You can’t perform that action at this time.
0 commit comments