小编the*_*man的帖子

sequelize 迁移未运行

我在使用 Sequelize 时遇到了一个我以前从未遇到过的奇怪问题,当我尝试运行迁移时没有任何反应。我得到以下输出:

Loaded configuration file "config\config.json"
Using environment "development"
Run Code Online (Sandbox Code Playgroud)

该程序刚刚存在。

我已经多次检查我的代码,一切都检查出来了。

型号代码:

module.exports = {
up: (queryInterface, Sequelize) => {
    return queryInterface.createTable("users", {
        id: {
            allowNull: false,
            autoIncrement: true,
            primaryKey: true,
            type: Sequelize.INTEGER
        },
        username: {
            type: Sequelize.STRING,
            unique: true,
            allowNull: false,
            validate: {
                notEmpty: true
            }
        },
        email: {
            type: Sequelize.STRING,
            unique: true,
            allowNull: false,
            validate: {
                notEmpty: true,
                isEmail: true
            }
        },
        password: {
            type: Sequelize.STRING,
            allowNull: false,
            validate: {
                notEmpty: true,
                len: [7, 42]
            }
        }, …
Run Code Online (Sandbox Code Playgroud)

migration orm node.js sequelize.js graphql

11
推荐指数
3
解决办法
3817
查看次数

标签 统计

graphql ×1

migration ×1

node.js ×1

orm ×1

sequelize.js ×1