Skip to content

include: option on add_index does nothing #1330

Closed
@jlammers-mas

Description

@jlammers-mas

The adapter seems to be able to derive included columns on an index during schema generation, but the add_index method "include:" option seems to do nothing. The adapter reports that it supports includes, but seems to only partially support it...

repro:

`class CreateSomeTable < ActiveRecord::Migration[8.0]
def change
create_table :some_table do |t|
t.varchar :field1, limit: 50
t.varchar :field2, limit: 50
t.varchar :field3, limit: 73

  t.timestamps
end
add_index :some_table, [ :field1, :field2], unique: true, include: :field3

end
end`

created a unique index on field1 and field2, but does not include field3

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions