gpt4 book ai didi

node.js - 我想通过 sequelize 更改表的列名

转载 作者:行者123 更新时间:2023-12-03 22:43:19 27 4
gpt4 key购买 nike

我正在尝试使用 queryInterface 更改表中列的名称,但下面的代码不起作用。为什么是这样?

const sequelize = require('sequelize')
const queryInterface = sequelize.getQueryInterface();

error : queryInterface is not a function

最佳答案

queryInterface 在您的 Sequelize 实例上可用。见 Obtaining the query interface

const { Sequelize, DataTypes } = require('sequelize');
const sequelize = new Sequelize(/* ... */);
const queryInterface = sequelize.getQueryInterface();

关于node.js - 我想通过 sequelize 更改表的列名,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65376989/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com