postgresql - 在使用 Postgres 的 Rails 中,如何在 UUID 数组上添加索引?
问题描述
我正在尝试使用 Postgres 9.6 在 Rails 中的 UUID 数组上添加索引。这是我的迁移...
class AddProductIdsToApplications < ActiveRecord::Migration[5.2]
def change
add_column :applications, :product_ids, :uuid, array: true, default: []
add_index :applications, :product_ids, using: 'gin'
end
end
我收到这个错误...
> PG::UndefinedObject: ERROR: data type uuid[] has no default operator class for access method "gin"
> HINT: You must specify an operator class for the index or define a default operator class for the data type.
是否有针对此的迁移修复?
解决方案
推荐阅读
- performance - 高延迟客户端会影响服务器上其他请求的处理时间吗?
- leaflet - 如何从传单中的地图中删除所有特征组?
- angular - 如何配置我的 Angular 库以依赖 Angular Material?
- javascript - 通过js文件到laravel的ajax调用
- asp.net - 尝试从视图访问模型到控制器编辑方法
- arrays - 根据另一个属性值在对象数组中查找属性值
- c - Flex 字符串识别“无法识别的规则”错误
- google-sheets - 如何将工作表查询结果折叠到单个单元格中
- spring-boot - Jhipster - 在 JHI_User 和另一个实体之间创建关系错误
- javascript - JS:检测被监视的 div 的 dom 突变(或将事件侦听器更改为 innerHTML)