mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 17:51:40 +09:00
자신을 참조하는 외래키는 생성 순서에 영향을 주지 않도록 변경 #2576
This commit is contained in:
parent
ba12e1b3a4
commit
108da2eac3
1 changed files with 7 additions and 2 deletions
|
|
@ -304,7 +304,13 @@ class DBTableParser extends BaseParser
|
||||||
if ($constraint->references)
|
if ($constraint->references)
|
||||||
{
|
{
|
||||||
$ref = explode('.', $constraint->references);
|
$ref = explode('.', $constraint->references);
|
||||||
$info->refs[] = $ref[0];
|
$reference_table_name = $ref[0];
|
||||||
|
if ($reference_table_name === $table_name)
|
||||||
|
{
|
||||||
|
continue; // Ignore self-references.
|
||||||
|
}
|
||||||
|
|
||||||
|
$info->refs[] = $reference_table_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ref_list[$table_name] = $info;
|
$ref_list[$table_name] = $info;
|
||||||
|
|
@ -328,7 +334,6 @@ class DBTableParser extends BaseParser
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$k++;
|
|
||||||
}
|
}
|
||||||
if (!$changed)
|
if (!$changed)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue