src/Phinx/Db/Adapter/MysqlAdapter.php 1 location
|
@@ 787-792 (lines=6) @@
|
| 784 |
|
empty($schema) ? 'DATABASE()' : "'$schema'", |
| 785 |
|
$tableName |
| 786 |
|
)); |
| 787 |
|
foreach ($rows as $row) { |
| 788 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['table'] = $row['TABLE_NAME']; |
| 789 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['columns'][] = $row['COLUMN_NAME']; |
| 790 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['referenced_table'] = $row['REFERENCED_TABLE_NAME']; |
| 791 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME']; |
| 792 |
|
} |
| 793 |
|
|
| 794 |
|
return $foreignKeys; |
| 795 |
|
} |
src/Phinx/Db/Adapter/PostgresAdapter.php 1 location
|
@@ 843-848 (lines=6) @@
|
| 840 |
|
$this->getConnection()->quote($parts['schema']), |
| 841 |
|
$this->getConnection()->quote($parts['table']) |
| 842 |
|
)); |
| 843 |
|
foreach ($rows as $row) { |
| 844 |
|
$foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; |
| 845 |
|
$foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; |
| 846 |
|
$foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; |
| 847 |
|
$foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; |
| 848 |
|
} |
| 849 |
|
|
| 850 |
|
return $foreignKeys; |
| 851 |
|
} |
src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location
|
@@ 924-929 (lines=6) @@
|
| 921 |
|
ORDER BY kcu.ordinal_position", |
| 922 |
|
$tableName |
| 923 |
|
)); |
| 924 |
|
foreach ($rows as $row) { |
| 925 |
|
$foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; |
| 926 |
|
$foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; |
| 927 |
|
$foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; |
| 928 |
|
$foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; |
| 929 |
|
} |
| 930 |
|
|
| 931 |
|
return $foreignKeys; |
| 932 |
|
} |