cli icon indicating copy to clipboard operation
cli copied to clipboard

Error: on undo migration command, the migrations does not behave the way it should

Open S2606 opened this issue 5 years ago • 5 comments

Issue Description

So, on running the command npx sequelize-cli db:migrate:undo, the command gives an error(screenshot is attached below)

Also, the record does not get unapplied from sequelize_meta table, so as to reapply it again

What are you doing?

'use strict';

module.exports = {
  up: async (queryInterface, Sequelize) => {
    await queryInterface.changeColumn(
      TableName,
      'col',
      {
        type: Sequelize.STRING(150), // Increased from 100
      }
    )

  }
};

What do you expect to happen?

recent migration should have reverted

What is actually happening?

Explained above

Additional context

image

Environment

  • Sequelize version: ^5.8.10
  • Node.js version: ^14.4.0

Issue Template Checklist

How does this problem relate to dialects?

  • [X] I think this problem happens regardless of the dialect.
  • [ ] I think this problem happens only for the following dialect(s):
  • [ ] I don't know, I was using PUT-YOUR-DIALECT-HERE, with connector library version XXX and database version XXX

Would you be willing to resolve this issue by submitting a Pull Request?

  • [ ] Yes, I have the time and I know how to start.
  • [X] Yes, I have the time but I don't know how to start, I would need guidance.
  • [ ] No, I don't have the time, although I believe I could do it if I had the time...
  • [ ] No, I don't have the time and I wouldn't even know how to start.

S2606 avatar Oct 23 '20 06:10 S2606

Same for me. In my case the command npx sequelize-cli db:migrate:undo:all seems to not run the down migrations in the correct order, which i think should be newest -> oldest

Doesn't happen locally, happens for me via heroku

EinfachHans avatar Feb 02 '21 09:02 EinfachHans

This issue has been automatically marked as stale because it has been open for 7 days without activity. It will be closed if no further activity occurs. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

github-actions[bot] avatar Oct 28 '21 00:10 github-actions[bot]

ping

EinfachHans avatar Nov 01 '21 16:11 EinfachHans

This issue has been automatically marked as stale because it has been open for 14 days without activity. It will be closed if no further activity occurs within the next 14 days. If this is still an issue, just leave a comment or remove the "stale" label. 🙂

github-actions[bot] avatar Nov 17 '21 00:11 github-actions[bot]

Hi @EinfachHans Do you happen to have a small example project for this error? That would help us out a lot with figuring out what the problem might be.

WikiRik avatar Nov 17 '21 00:11 WikiRik