Skip to content

Generated migration imports failing #11

@krlicmuhamed

Description

@krlicmuhamed

What you are doing?

I am trying to generate a model that has a migration with it

import {
    QueryInterface,
    SequelizeStatic,
} from 'sequelize';

export = {
    up: (queryInterface: QueryInterface, Sequelize: SequelizeStatic) => {
        return queryInterface.createTable('Devices', {
            id: {
                allowNull: false,
                autoIncrement: true,
                primaryKey: true,
                type: Sequelize.INTEGER
            },

            deviceName: {
                type: Sequelize.STRING
            },

            imei: {
                type: Sequelize.STRING
            },

            createdAt: {
                allowNull: false,
                type: Sequelize.DATE
            },

            updatedAt: {
                allowNull: false,
                type: Sequelize.DATE
            }
        });
    },

    down: (queryInterface: QueryInterface, Sequelize: SequelizeStatic) => {
        return queryInterface.dropTable('Devices');
    }
};

What do you expect to happen?

I expected SequelizeStatic to be working and to be declared

What is actually happening?

However, SequelizeStatic apparently doesn't exist, why is that?
Image of the error
Module '"../../node_modules/sequelize/types"' has no exported member 'SequelizeStatic'.ts(2305)
Dialect: mysql / postgres / sqlite / mssql / any
Database version: 9.5
Sequelize CLI version: 3.2.0-c
Sequelize version: 5.22.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions