1
0
mirror of https://github.com/vrana/adminer.git synced 2025-08-15 11:04:02 +02:00

Copy triggers when copying table

This commit is contained in:
Jakub Vrana
2018-05-06 17:36:52 +02:00
parent 84c65fcca6
commit 7b60b03e6a
2 changed files with 7 additions and 0 deletions

View File

@@ -811,6 +811,12 @@ if (!defined("DRIVER")) {
) {
return false;
}
foreach (get_rows("SHOW TRIGGERS LIKE " . q(addcslashes($table, "%_\\"))) as $row) {
$trigger = $row["Trigger"];
if (!queries("CREATE TRIGGER " . ($target == DB ? idf_escape("copy_$trigger") : idf_escape($target) . "." . idf_escape($trigger)) . " $row[Timing] $row[Event] ON $name FOR EACH ROW\n$row[Statement];")) {
return false;
}
}
}
foreach ($views as $table) {
$name = ($target == DB ? table("copy_$table") : idf_escape($target) . "." . table($table));