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

PostgreSQL: Export all FKs after all CREATE TABLE

This commit is contained in:
Ivan Masár
2019-07-19 13:17:10 +02:00
committed by Jakub Vrana
parent 97ec60bb5f
commit 34345d8071
3 changed files with 48 additions and 5 deletions

View File

@@ -105,6 +105,16 @@ SET foreign_key_checks = 0;
}
}
// add FKs after creating tables (except in MySQL which uses SET FOREIGN_KEY_CHECKS=0)
if (function_exists('foreign_keys_sql')) {
foreach (table_status('', true) as $name => $table_status) {
$table = (DB == "" || in_array($name, (array) $_POST["tables"]));
if ($table && !is_view($table_status)) {
echo foreign_keys_sql($name);
}
}
}
foreach ($views as $view) {
$adminer->dumpTable($view, $_POST["table_style"], 1);
}