Skip to content

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

Open
@S2606

Description

@S2606

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?

  • 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.
  • 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions