在 BLOB 字段上继承 addIndex
Sequelize addIndex on BLOB Field
我将 Sequelize v6 与 mariaDB 一起使用。当我尝试在迁移文件中执行以下操作时:
return queryInterface.addIndex('RVersion', ['terms'], {
indicesType: 'FULLTEXT'
});
我收到以下错误消息:
BLOB/TEXT column 'terms' used in key specification without a key length
在 sequelize 中创建这个索引的正确方法是什么?
在选项中使用 fields
选项而不是像这样的第二个参数:
return queryInterface.addIndex('RVersion', {
fields: [{
name: 'terms',
length: 255
}],
type: 'FULLTEXT' // this option name is `type`
});
我将 Sequelize v6 与 mariaDB 一起使用。当我尝试在迁移文件中执行以下操作时:
return queryInterface.addIndex('RVersion', ['terms'], {
indicesType: 'FULLTEXT'
});
我收到以下错误消息:
BLOB/TEXT column 'terms' used in key specification without a key length
在 sequelize 中创建这个索引的正确方法是什么?
在选项中使用 fields
选项而不是像这样的第二个参数:
return queryInterface.addIndex('RVersion', {
fields: [{
name: 'terms',
length: 255
}],
type: 'FULLTEXT' // this option name is `type`
});