defmodule SimpleshopTheme.Repo.Migrations.AddImageIdToProductImages do
  use Ecto.Migration

  def change do
    alter table(:product_images) do
      add :image_id, references(:images, type: :binary_id, on_delete: :nilify_all)
    end

    create index(:product_images, [:image_id])
  end
end
