diff options
author | Brion Vibber <brion@pobox.com> | 2010-10-07 16:23:36 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-10-07 16:23:36 -0700 |
commit | 312b87ea79659b168bdc9569b735253d77994530 (patch) | |
tree | 1866405cce748da72a877a3729199da30dfdbd4b /scripts/dumpschema.php | |
parent | fcef2aaab752db9441c1976b5ce98d55d240e489 (diff) |
output tweak hack for primary keys on single line
Diffstat (limited to 'scripts/dumpschema.php')
-rw-r--r-- | scripts/dumpschema.php | 11 |
1 files changed, 9 insertions, 2 deletions
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"; } |