From 312b87ea79659b168bdc9569b735253d77994530 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Thu, 7 Oct 2010 16:23:36 -0700 Subject: output tweak hack for primary keys on single line --- scripts/dumpschema.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts/dumpschema.php') diff --git a/scripts/dumpschema.php b/scripts/dumpschema.php index 5a0fd0bdb..8b5277517 100644 --- a/scripts/dumpschema.php +++ b/scripts/dumpschema.php @@ -48,8 +48,15 @@ function indentOptions($indent) function prettyDumpArray($arr, $key=null, $indent=0) { + // hack + if ($key == 'primary key') { + $subIndent = $indent + 2; + } else { + $subIndent = $indent + 1; + } + list($space, $sep, $lf, $endspace) = indentOptions($indent); - list($inspace, $insep, $inlf, $inendspace) = indentOptions($indent + 1); + list($inspace, $insep, $inlf, $inendspace) = indentOptions($subIndent); print "{$space}"; if (!is_numeric($key)) { @@ -60,7 +67,7 @@ function prettyDumpArray($arr, $key=null, $indent=0) $n = 0; foreach ($arr as $key => $row) { $n++; - prettyDumpArray($row, $key, $indent + 1); + prettyDumpArray($row, $key, $subIndent); if ($n < count($arr)) { print "$insep$inlf"; } -- cgit v1.2.3-54-g00ecf