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) {
9
9
const migrationsStorage = useMigrationsStorage ( hub )
10
10
const db = hubDatabase ( )
11
11
12
+ await db . prepare ( CreateMigrationsTableQuery ) . all ( )
12
13
const appliedMigrations = ( await db . prepare ( AppliedMigrationsQuery ) . all ( ) ) . results
13
14
const localMigrations = ( await getMigrationFiles ( hub ) ) . map ( fileName => fileName . replace ( '.sql' , '' ) )
14
15
const pendingMigrations = localMigrations . filter ( localName => ! appliedMigrations . find ( ( { name } ) => name === localName ) )
@@ -18,7 +19,6 @@ export async function applyMigrations(hub: HubConfig) {
18
19
let query = await migrationsStorage . getItem < string > ( `${ migration } .sql` )
19
20
if ( ! query ) continue
20
21
query += `
21
- ${ CreateMigrationsTableQuery }
22
22
INSERT INTO _hub_migrations (name) values ('${ migration } ');
23
23
`
24
24
const queries = splitSqlQueries ( query )
You can’t perform that action at this time.
0 commit comments