mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-03 16:51:40 +09:00
Merge pull request #2578 from Waterticket/fk-issue
Fix #2576 자신을 참조하는 외래키는 생성 순서에 영향을 주지 않도록 변경
This commit is contained in:
commit
7ce1f17bea
1 changed files with 7 additions and 2 deletions
|
|
@ -304,7 +304,13 @@ class DBTableParser extends BaseParser
|
|||
if ($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;
|
||||
|
|
@ -328,7 +334,6 @@ class DBTableParser extends BaseParser
|
|||
}
|
||||
}
|
||||
}
|
||||
$k++;
|
||||
}
|
||||
if (!$changed)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue