mirror of
https://github.com/vrana/adminer.git
synced 2025-08-18 04:11:27 +02:00
Support for virtual foreign keys
This commit is contained in:
@@ -108,6 +108,14 @@ document.getElementById('username').focus();
|
||||
echo "\n";
|
||||
}
|
||||
|
||||
/** Get foreign keys for table
|
||||
* @param string
|
||||
* @return array same format as foreign_keys()
|
||||
*/
|
||||
function foreignKeys($table) {
|
||||
return foreign_keys($table);
|
||||
}
|
||||
|
||||
/** Find backward keys for table
|
||||
* @param string
|
||||
* @param string
|
||||
|
@@ -550,8 +550,9 @@ function hidden_fields_get() {
|
||||
* @return array array($col => array())
|
||||
*/
|
||||
function column_foreign_keys($table) {
|
||||
global $adminer;
|
||||
$return = array();
|
||||
foreach (foreign_keys($table) as $foreign_key) {
|
||||
foreach ($adminer->foreignKeys($table) as $foreign_key) {
|
||||
foreach ($foreign_key["source"] as $val) {
|
||||
$return[$val][] = $foreign_key;
|
||||
}
|
||||
|
Reference in New Issue
Block a user