在迁移过程中,我有以下几点:
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
?