Skip to content

Migration timeouts #696

Answered by mmkal
ofekatr asked this question in Ideas
Discussion options

You must be logged in to vote

Nothing out of the box, but I'm open to it if you can think of a clean API. Would need to make sure it's clear what happens when a migration times out, whether a timeout config is global or local, can it be overridden etc.

I don't want to go far as to say that this is the official recommended way to do this, but you could do something like

import { Umzug } from 'umzug'

const migrator = new Umzug({
  migrations: {
    glob: 'migrations/*.js',
    resolve(params) {
      const base = Umzug.defaultResolver(params);
      return {
        ...base,
        async up(upParams) {
          return Promise.race([
            base.up(upParams),
            new Promise((_resolve, reject) =>

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by mmkal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #618 on January 08, 2025 17:56.