1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-12 01:24:17 +02:00

Foreign keys: Switch schema back after getting the tables

This commit is contained in:
Jakub Vrana
2025-02-26 15:57:52 +01:00
parent efb1eb9d6b
commit c38b967fc4
4 changed files with 11 additions and 3 deletions

View File

@@ -477,6 +477,7 @@ WHERE OBJECT_NAME(i.object_id) = " . q($table)
foreach (get_rows("EXEC sp_fkeys @fktable_name = " . q($table) . ", @fktable_owner = " . q(get_schema())) as $row) {
$foreign_key = &$return[$row["FK_NAME"]];
$foreign_key["db"] = $row["PKTABLE_QUALIFIER"];
$foreign_key["ns"] = $row["PKTABLE_OWNER"];
$foreign_key["table"] = $row["PKTABLE_NAME"];
$foreign_key["on_update"] = $on_actions[$row["UPDATE_RULE"]];
$foreign_key["on_delete"] = $on_actions[$row["DELETE_RULE"]];
@@ -556,6 +557,7 @@ WHERE sys1.xtype = 'TR' AND sys2.name = " . q($table)
}
function set_schema($schema) {
$_GET["ns"] = $schema;
return true; // ALTER USER is permanent
}