src/Phinx/Db/Adapter/MysqlAdapter.php 1 location
|
@@ 797-802 (lines=6) @@
|
| 794 |
|
empty($schema) ? 'DATABASE()' : "'$schema'", |
| 795 |
|
$tableName |
| 796 |
|
)); |
| 797 |
|
foreach ($rows as $row) { |
| 798 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['table'] = $row['TABLE_NAME']; |
| 799 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['columns'][] = $row['COLUMN_NAME']; |
| 800 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['referenced_table'] = $row['REFERENCED_TABLE_NAME']; |
| 801 |
|
$foreignKeys[$row['CONSTRAINT_NAME']]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME']; |
| 802 |
|
} |
| 803 |
|
|
| 804 |
|
return $foreignKeys; |
| 805 |
|
} |
src/Phinx/Db/Adapter/PostgresAdapter.php 1 location
|
@@ 854-859 (lines=6) @@
|
| 851 |
|
$this->getConnection()->quote($parts['schema']), |
| 852 |
|
$this->getConnection()->quote($parts['table']) |
| 853 |
|
)); |
| 854 |
|
foreach ($rows as $row) { |
| 855 |
|
$foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; |
| 856 |
|
$foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; |
| 857 |
|
$foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; |
| 858 |
|
$foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; |
| 859 |
|
} |
| 860 |
|
|
| 861 |
|
return $foreignKeys; |
| 862 |
|
} |
src/Phinx/Db/Adapter/SqlServerAdapter.php 1 location
|
@@ 944-949 (lines=6) @@
|
| 941 |
|
ORDER BY kcu.ordinal_position", |
| 942 |
|
$tableName |
| 943 |
|
)); |
| 944 |
|
foreach ($rows as $row) { |
| 945 |
|
$foreignKeys[$row['constraint_name']]['table'] = $row['table_name']; |
| 946 |
|
$foreignKeys[$row['constraint_name']]['columns'][] = $row['column_name']; |
| 947 |
|
$foreignKeys[$row['constraint_name']]['referenced_table'] = $row['referenced_table_name']; |
| 948 |
|
$foreignKeys[$row['constraint_name']]['referenced_columns'][] = $row['referenced_column_name']; |
| 949 |
|
} |
| 950 |
|
|
| 951 |
|
return $foreignKeys; |
| 952 |
|
} |