【发布时间】:2015-04-27 22:22:12
【问题描述】:
我在迁移中有以下内容:
create_table :model_with_a_long_name do |t|
t.references :other_model_with_an_equally_long_name, index: true
end
这会为 Postgres 生成一个名称过长的索引。
有没有办法手动指定索引名称(不单独添加整数列和索引)?
类似于以下内容:
create_table :model_with_a_long_name do |t|
t.references :other_model_with_an_equally_long_name, index: true, index_name: 'model_and_other'
end
?
【问题讨论】:
标签: ruby-on-rails ruby