Heelo:
I have this table migration:
create table(:products) do
add :name, :string
add :price, :integer
add :sku, :string
end
I also created a unique index on:
create unique_index(:products, [:name, :price], name: :name_price_unique_index)
What I want to do is to add :sku
to the unique index columns.
In Postgres it would be something like this:
CREATE UNIQUE INDEX CONCURRENTLY newidx ON products (name, price, sku);
DROP INDEX name_price_unique_index;
ALTER INDEX newidx RENAME TO name_price_sku_unique_index;
But how can I do this with an Ecto migration?