We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7a4cb1 commit ef4a683Copy full SHA for ef4a683
index.js
@@ -28,17 +28,19 @@ export default async function({
28
const current = await getCurrentMigration()
29
const needed = migrations.slice(current ? current.id : 0)
30
31
- return sql.begin(next)
+ return next()
32
33
- async function next(sql) {
34
- const current = needed.shift()
35
- if (!current)
36
- return
+ async function next() {
+ await sql.begin(async (sql) => {
+ const current = needed.shift()
+ if (!current)
37
+ return
38
- before && before(current)
39
- await run(sql, current)
40
- after && after(current)
41
- await next(sql)
+ before && before(current)
+ await run(sql, current)
+ after && after(current)
42
+ })
43
+ await next()
44
}
45
46
async function run(sql, {
0 commit comments