Comments (1)
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) =>
setTimeout(() => {
reject(new Error('timeout'));
}, 1000)
),
]);
},
async down(downParams) {
return Promise.race([
base.down(downParams),
new Promise((_resolve, reject) =>
setTimeout(() => {
reject(new Error('timeout'));
}, 1000)
),
]);
},
};
},
})
from umzug.
Related Issues (20)
- Update to V3 of umzug does not appear to have compatible @types/umzug HOT 7
- Example migration not working HOT 5
- Alter colum or drop colum migration in SQLITE generates a new table without onUpdate and onDelete configurations HOT 2
- Migrate to ESM-first HOT 16
- Issue with identifying migration files as input to umzug instance HOT 1
- SequelizeStorage model uses options that are rejected by sequelize v7 + postgres et al HOT 5
- Breaking change in v3.3.0 HOT 5
- `RunAsCLI()` swallows exceptions HOT 4
- UP ALLOW not working correctly HOT 1
- Do not set charset and collate options on postgresql HOT 12
- mjs extension support HOT 1
- Snyk find issue in [email protected] > [email protected] > [email protected] HOT 2
- Update `type-fest` to `^4.10.2` to ensure compatibility with TypeScript 5.4 HOT 1
- Logging inside a migration script HOT 1
- TypeError: The "original" argument must be of type function. Received undefined HOT 6
- Glob v10 does not support Node 12 HOT 1
- bug: error with charset & collate in postgres with v7 HOT 2
- Only URLs with a scheme in: file, data, and node are supported by the default ESM loader
- Type 'ErrorWithCause' is not generic HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from umzug.