From 4801da091bc53938f9c67cf74c46cedd306d3c25 Mon Sep 17 00:00:00 2001 From: Matthew Gamble Date: Sun, 6 Dec 2015 10:14:55 +1100 Subject: [PATCH] Add plugin for printing table structure in expanded format Instead of trying to squeeze everything into three columns, this plugin uses multiple columns for each part of a column's structure. --- plugins/table-structure.php | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 plugins/table-structure.php diff --git a/plugins/table-structure.php b/plugins/table-structure.php new file mode 100644 index 00000000..5d8e5c05 --- /dev/null +++ b/plugins/table-structure.php @@ -0,0 +1,31 @@ +\n"; + echo "" . lang('Column') . "" . lang('Type') . "" . lang('Nullable') . "" . lang('Default') . (support("comment") ? "" . lang('Comment') : "") . "\n"; + foreach ($fields as $field) { + echo "" . h($field["field"]) . ($field["primary"] ? " (PRIMARY)" : ""); + echo "" . h($field["full_type"]) . ""; + echo ($field["auto_increment"] ? " " . lang('Auto Increment') . "" : ""); + echo ($field["collation"] ? " " . h($field["collation"]) . "" : ""); + echo "" . ($field["null"] ? lang('Yes') : lang('No')); + echo "" . (isset($field["default"]) ? h($field["default"]) : " "); + echo (support("comment") ? "" . nbsp($field["comment"]) : ""); + echo "\n"; + } + echo "\n"; + return true; + } +}