diff --git a/integration_test/support/migration.exs b/integration_test/support/migration.exs index c5c83b4cd..4abda1513 100644 --- a/integration_test/support/migration.exs +++ b/integration_test/support/migration.exs @@ -27,6 +27,8 @@ defmodule Ecto.Integration.Migration do add :intensity, :float add :author_id, :integer add :posted, :date + add :composite_a, :integer + add :composite_b, :integer timestamps(null: true) end @@ -108,6 +110,11 @@ defmodule Ecto.Integration.Migration do add :name, :string end + # TODO not sure if it is important to have a foreign keys defined properly; see other associations in "posts" + alter table(:posts) do + modify :composite_a, references(:composite_pk, column: :a, with: [composite_b: :b], type: :integer) + end + create table(:corrupted_pk, primary_key: false) do add :a, :string end