File tree Expand file tree Collapse file tree 1 file changed +1
-1
lines changed
src/runtime/database/server/utils/migrations Expand file tree Collapse file tree 1 file changed +1
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export async function applyMigrations(hub: HubConfig) {
99 const migrationsStorage = useMigrationsStorage ( hub )
1010 const db = hubDatabase ( )
1111
12+ await db . prepare ( CreateMigrationsTableQuery ) . all ( )
1213 const appliedMigrations = ( await db . prepare ( AppliedMigrationsQuery ) . all ( ) ) . results
1314 const localMigrations = ( await getMigrationFiles ( hub ) ) . map ( fileName => fileName . replace ( '.sql' , '' ) )
1415 const pendingMigrations = localMigrations . filter ( localName => ! appliedMigrations . find ( ( { name } ) => name === localName ) )
@@ -18,7 +19,6 @@ export async function applyMigrations(hub: HubConfig) {
1819 let query = await migrationsStorage . getItem < string > ( `${ migration } .sql` )
1920 if ( ! query ) continue
2021 query += `
21- ${ CreateMigrationsTableQuery }
2222 INSERT INTO _hub_migrations (name) values ('${ migration } ');
2323 `
2424 const queries = splitSqlQueries ( query )
You can’t perform that action at this time.
0 commit comments