From: Brion Vibber Date: Thu, 7 Oct 2010 23:23:36 +0000 (-0700) Subject: output tweak hack for primary keys on single line X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=312b87ea79659b168bdc9569b735253d77994530;p=quix0rs-gnu-social.git output tweak hack for primary keys on single line --- diff --git a/db/core.php b/db/core.php index 1633187b4b..940ad5d07f 100644 --- a/db/core.php +++ b/db/core.php @@ -457,7 +457,7 @@ $schema['foreign_service'] = array( $schema['foreign_user'] = array( 'fields' => array( - 'id' => array('type' => 'bigint', 'not null' => true, 'description' => 'unique numeric key on foreign service'), + 'id' => array('type' => 'int', 'size' => 'big', 'not null' => true, 'description' => 'unique numeric key on foreign service'), 'service' => array('type' => 'int', 'not null' => true, 'description' => 'foreign key to service'), 'uri' => array('type' => 'varchar', 'length' => 255, 'not null' => true, 'description' => 'identifying URI'), 'nickname' => array('type' => 'varchar', 'length' => 255, 'description' => 'nickname on foreign service'), diff --git a/scripts/dumpschema.php b/scripts/dumpschema.php index 5a0fd0bdbb..8b5277517f 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"; }