小编Jam*_*Jam的帖子

Sequelize字段必须通过options.field指定错误

所以我创建了一个表并稍后修改它以添加外键。我按照这个/sf/answers/3319971231/但它给了我一个错误,说

“错误:必须通过 options.fields 指定字段”

我正在使用sequelize ^6.6.5,我的节点版本是14.17.6,下面提供了我的代码

module.exports = {
  up: async (queryInterface, Sequelize) =>
    Promise.all([
      await queryInterface.addColumn('bonus_transactions', 'wallet_id', {
        type: Sequelize.INTEGER.UNSIGNED,
        allowNull: false,
        after: 'order_id'
      }),
      await queryInterface.addConstraint('bonus_transactions', ['wallet_id'], {
        type: 'FOREIGN KEY',
        name: 'FK_bonus_transactions_wallet_id',
        references: {
          table: 'wallets',
          field: 'id'
        },
        onDelete: 'CASCADE'
      })
    ]),
  down: queryInterface => queryInterface.removeColumn('bonus_transactions', 'wallet_id')
Run Code Online (Sandbox Code Playgroud)

这可能是因为续集版本的原因吗?我搜索了 v6 文档,似乎没有任何与此类似的实现。

mysql orm node.js express sequelize.js

4
推荐指数
1
解决办法
2722
查看次数

Vue.js 超出最大调用堆栈大小

我正在按照本教程进行操作,由于某种原因,我收到“最大调用堆栈错误”

<template>
  <SearchInput></SearchInput>
</template>

<script>

import SearchInput from './components/SearchInput.vue'
export default {
  name: 'App',
  components:{
    SearchInput
  }

};
</script>
Run Code Online (Sandbox Code Playgroud)

SearchInput.vue组件文件:

<template>
<SearchInput> 
    <input type="text">
</SearchInput>
</template>


<script>
export default {
    name: "SearchInput",
}
</script>
Run Code Online (Sandbox Code Playgroud)

我尝试为 SearchInput 指定自己的名称“SearchInputView”:SearchInput 但它不起作用。我使用 es6 语法,这是一个 Vue 2 项目。我究竟做错了什么?

frontend web vue.js vue-component vuejs2

0
推荐指数
1
解决办法
2729
查看次数

标签 统计

express ×1

frontend ×1

mysql ×1

node.js ×1

orm ×1

sequelize.js ×1

vue-component ×1

vue.js ×1

vuejs2 ×1

web ×1