AD
Size: a a a
AD
ŹR
AK
:primary_key - when true, marks this field as the primary key
ŹR
ŹR
ŹR
IB
AD
AD
IB
def change do
create table("test", primary_key: false) do
add :id1, :bigint, primary_key: true
add :id2, :bigint, primary_key: true
end
end
def change do
create table("other_test") do
add :test_id, references("test") # не работает
end
end
AD
ŹR
ŹR
AK
def change do
create table("test", primary_key: false) do
add :id1, :bigint, primary_key: true
add :id2, :bigint, primary_key: true
end
end
def change do
create table("other_test") do
add :test_id, references("test") # не работает
end
end
add :id1, :bigint, primary_key: true
add :id2, :bigint
create index(:test, [:id1, :id2], unique: true)
IB
references
пытается сразу исполнить SQLFOREIGN KEY test_id REFERENCES test (id)
FOREIGN KEY (test_id1, test_id2) REFERENCES test (id1, id2)
IB
Ecto.Migration.references/2
в это не умеетAD
IB
add :id1, :bigint, primary_key: true
add :id2, :bigint
create index(:test, [:id1, :id2], unique: true)
ŹR