From 978c0e6869be29858b011908c4aa2aecde68e688 Mon Sep 17 00:00:00 2001 From: Miles Lott Date: Tue, 24 Feb 2004 21:32:20 +0000 Subject: [PATCH] Add bool type from latest schema_proc from dcl --- phpgwapi/inc/class.schema_proc_mssql.inc.php | 8 +++++++- phpgwapi/inc/class.schema_proc_mysql.inc.php | 3 +++ phpgwapi/inc/class.schema_proc_pgsql.inc.php | 16 +++++++--------- 3 files changed, 17 insertions(+), 10 deletions(-) diff --git a/phpgwapi/inc/class.schema_proc_mssql.inc.php b/phpgwapi/inc/class.schema_proc_mssql.inc.php index 9f9721bc8c..fbd42f58df 100644 --- a/phpgwapi/inc/class.schema_proc_mssql.inc.php +++ b/phpgwapi/inc/class.schema_proc_mssql.inc.php @@ -87,6 +87,9 @@ case 'timestamp': $sTranslated = 'datetime'; break; + case 'bool': + $sTranslated = 'bit'; + break; case 'varchar': if ($iPrecision > 0 && $iPrecision < 256) { @@ -180,13 +183,16 @@ case 'text': $sTranslated = "'type' => '$sType'"; break; + case 'bit': + $sTranslated = "'type' => 'bool'"; + break; } return $sTranslated; } function GetPKSQL($sFields) { - return "PRIMARY KEY($sFields)"; + return "PRIMARY KEY NONCLUSTERED ($sFields)"; } function GetUCSQL($sFields) diff --git a/phpgwapi/inc/class.schema_proc_mysql.inc.php b/phpgwapi/inc/class.schema_proc_mysql.inc.php index 3e71c5fec8..326e987070 100644 --- a/phpgwapi/inc/class.schema_proc_mysql.inc.php +++ b/phpgwapi/inc/class.schema_proc_mysql.inc.php @@ -41,6 +41,9 @@ case 'blob': $sTranslated = 'blob'; break; + case 'bool': + $sTranslated = 'tinyint(1)'; + break; case 'char': if($iPrecision > 0 && $iPrecision < 256) { diff --git a/phpgwapi/inc/class.schema_proc_pgsql.inc.php b/phpgwapi/inc/class.schema_proc_pgsql.inc.php index f7ec412b45..0f5fce9034 100644 --- a/phpgwapi/inc/class.schema_proc_pgsql.inc.php +++ b/phpgwapi/inc/class.schema_proc_pgsql.inc.php @@ -54,9 +54,6 @@ $sTranslated = 'text'; } break; - case 'date': - $sTranslated = 'date'; - break; case 'decimal': $sTranslated = sprintf("decimal(%d,%d)", $iPrecision, $iScale); break; @@ -75,12 +72,6 @@ case 'longtext': $sTranslated = 'text'; break; - case 'text': - $sTranslated = 'text'; - break; - case 'timestamp': - $sTranslated = 'timestamp'; - break; case 'varchar': if($iPrecision > 0 && $iPrecision < 256) { @@ -91,6 +82,12 @@ $sTranslated = 'text'; } break; + case 'date': + case 'text': + case 'timestamp': + case 'bool': + $sTranslated = $sType; + break; } return $sTranslated; } @@ -164,6 +161,7 @@ case 'text': case 'blob': case 'date': + case 'bool'; $sTranslated = "'type' => '$sType'"; break; }