summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorBrion Vibber <brion@pobox.com>2010-10-07 16:23:36 -0700
committerBrion Vibber <brion@pobox.com>2010-10-07 16:23:36 -0700
commit312b87ea79659b168bdc9569b735253d77994530 (patch)
tree1866405cce748da72a877a3729199da30dfdbd4b /scripts
parentfcef2aaab752db9441c1976b5ce98d55d240e489 (diff)
output tweak hack for primary keys on single line
Diffstat (limited to 'scripts')
-rw-r--r--scripts/dumpschema.php11
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";
}