[英]sequelize.js addIndex not using indexName
I am trying to create an index using sequelize.js addIndex function, the index is created but not with the name specified in the indexName option.我正在尝试使用 sequelize.js addIndex 函数创建索引,该索引已创建但未使用 indexName 选项中指定的名称。
I am using the code below我正在使用下面的代码
queryInterface.addIndex('Item',
['name', 'description'], {
indicesType: 'FULLTEXT',
indexName: 'idx_item_fulltext'
})
After running migration, the index is created with the name 'item_name_description' and not 'idx_item_fulltext' which is the name I specified.运行迁移后,将使用名称“item_name_description”而不是我指定的名称“idx_item_fulltext”创建索引。
For sequelize-cli
and sequelize
version 5+
there are no indicesType
and indexName
properties in addIndex options:对于sequelize-cli
和sequelize
5+
版本, addIndex选项中没有indicesType
和indexName
属性:
Please try:请尝试:
queryInterface.addIndex('Item', ['name', 'description'], {
type: 'FULLTEXT',
name: 'idx_item_fulltext'
})
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.