Questions tagged [umzug]

21 questions
7
votes
1 answer

How to define default schema for sequelize migrations when using postgres and umzug?

I am trying to always run migrations with sequelize and umzug to a specific postgresql database schema. Lets call it custom schema. By default all queries go to public schema. Is there any way to define the default schema to run all migrations to in…
Rochet2
  • 1,146
  • 1
  • 8
  • 13
7
votes
0 answers

What are the key differences between model and migration definitions in Sequelize?

Some Sequelize users of SQL databases often use sync({ force: true }) in the early days, and then switch over to migrations. I'm confused because the migrations and models seem to have a similar syntax, but also a number of differences that don't…
user1985427
  • 353
  • 3
  • 11
3
votes
1 answer

Sequelize umzug migrations

I am using sequelize js and developed a node js application, which is deployed to production and have live DB. while in development mode, if I need to alter the DB, I used to do it using Sequelize.sync({ force: true }) and it worked well. But now,…
Sravan
  • 18,467
  • 3
  • 30
  • 54
3
votes
1 answer

Promise chaining in Sequelize migrations - relation does not exist

This simple test code: return queryInterface.createTable('tadam', {id: Sequelize.INTEGER, humus: Sequelize.STRING(255)}) .then(queryInterface.sequelize.query('ALTER TABLE tadam ADD PRIMARY KEY (id)')); returns the following error: Unhandled…
Milkncookiez
  • 6,817
  • 10
  • 57
  • 96
2
votes
1 answer

How to resolve path to migrations folder after webpack bundling

I need to pass to Umzug config a path to migrations folder but it is being compressed by webpack is it possible to do? I've tried to bundle each migrations file separately but Umzug saying that it cannot find method up(). let umzug = new…
bgr11n
  • 149
  • 9
2
votes
1 answer

How to pass an array of migration instances in umzug config

I'm using umzug to run the migrations in my electron-vue app, because of the webpack I can't use the path like migrations: { path: __dirname + '/../migrations', pattern: /\.js$/ } So I heard I can pass migrations instances, but I don't know…
Wuzi
  • 386
  • 7
  • 17
1
vote
1 answer

Running sequilize migration with umzug through github ci/cd

im using sequlize with umzug - migrations work locally, when i create a job for it, it cannot find the neccessery modules. I got a mirgrator.js file. const { migrator } = require('./iumzug.js'); migrator.runAsCLI() And an iumzug.ts file as well,…
shahar
  • 89
  • 1
  • 5
1
vote
2 answers

How to import stuff from your project in Umzug migrations?

I want to use my other code in an Umzug migration. I use Umzug with Sequelize in a NestJS project. Umzug config: require('ts-node/register') const umzug = new Umzug({ migrations: { path: process.env.MIGRATIONS_PATH, pattern:…
gvlasov
  • 18,638
  • 21
  • 74
  • 110
1
vote
0 answers

Process of changing a table with sequelize migration if foreign key constraint is active

We use sequelize and Umzug within our nodejs project for database changes needed. It is very important that all data within the database will survive a migration from version to version as we talk about migrations at several productively used…
MadMaxAPP
  • 1,035
  • 2
  • 16
  • 39
1
vote
1 answer

Recommendations for serverless web app Data migration

I'm building a serverless web application using: API-gateway, S3, DynamoDB, Cloud Formation, ... I have come to a point where I'm adding a new feature that requires some data in S3 and DynamoDB to be migrated. I could of course write a one-off…
Karel
  • 185
  • 2
  • 7
1
vote
3 answers

Making reproducible string of migrations for Sequelize with models changing over time?

I'm building my first migration system ever with Umzug and Sequelize for a node app which uses sequelize and express on the backend. My issue is that as the back end models change with commits over time (models being deleted, some changing, some…
Henry
  • 491
  • 4
  • 13
1
vote
1 answer

Migrations - SequqlizeCLI and/or Umzug with node.js. Difference between using Sequelize CLI and Umzug?

I am new to using Sequelize and Umzug with Node.js. I have installed the Sequelize CLI and have tested migrations and seems to work great. I read that umzug is used by some teams to create these migrations. I am not clear on what is the difference…
user4101343
0
votes
0 answers

How to rollback database migrations when switching back to previous application version

In my nodejs application, i am using a library(Umzug) which will handle database migrations with the help of migration files where each migration file contains up(to execute the migration) and down(to rollback the migration) functions Migration…
Pavan
  • 1
  • 2
0
votes
1 answer

How to migrate/seed sequelize-cli files using Umzug

I know that I currently have sequelize.sync commented out. But otherwise it would generate my tables automatically and I wouldn't know if my dbmigrate.js actually worked. My problem: I want to call the file dbmigrate.js. This file should fill my…
0
votes
0 answers

sequelize migrations in typescript

I am using PostrageSQL, sequelize with umzug for the first time with typescript and it fails to read the migrations, should I create the migration files in Javascript despite the project being in TypeScript? or is it bad practice? I'm getting…
1
2