change_table :streams do |t|
t.index(
expression: "dependencies->'stream_ids'",
using: :gin,
name: 'index_streams_on_dependencies_stream_ids',
)
end
but SchemaPlus doesn't seem to respect the name field and an automatic one is generated:
ArgumentError: Index name 'index_streams_on_{:expression=>"dependencies->'stream_ids'", :using=>:gin, :name=>"index_streams_on_dependencies_stream_ids"}' on table 'streams' is too long; the limit is 63 characters
If the equivalent thing is done with add_index then everything is fine:
add_index(
:streams,
:dependencies,
# note parentheses required here to get correct double-parentheses in result
expression: "(dependencies->'stream_ids')",
using: :gin,
name: 'index_streams_on_dependencies_stream_ids'
)
A migration contains this index addition:
but SchemaPlus doesn't seem to respect the
name
field and an automatic one is generated:If the equivalent thing is done with
add_index
then everything is fine:then
name
is respected.Running from
schema_plus
@master
,psql
@9.4.1
.