From d9699fa28d2be89acd9b54bdf1a471c576586ffb Mon Sep 17 00:00:00 2001 From: ClayLennart Date: Tue, 15 Jul 2014 09:44:01 +0200 Subject: [PATCH] Add bigint support --- code/PostgreSQLSchemaManager.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/code/PostgreSQLSchemaManager.php b/code/PostgreSQLSchemaManager.php index f9c41be..9992992 100644 --- a/code/PostgreSQLSchemaManager.php +++ b/code/PostgreSQLSchemaManager.php @@ -1117,6 +1117,32 @@ class PostgreSQLSchemaManager extends DBSchemaManager { return "integer{$values['arrayValue']}" . $default; } + /** + * Return a bigint type-formatted string + * + * @param array $values Contains a tokenised list of info about this data type + * @param boolean $asDbValue + * @return string + */ + public function bigint($values, $asDbValue = false){ + + if(!isset($values['arrayValue'])) { + $values['arrayValue']=''; + } + + if($asDbValue) { + return Array('data_type'=>'bigint', 'precision'=>'64'); + } + + if($values['arrayValue']!='') { + $default=''; + } else { + $default=' default ' . (int)$values['default']; + } + + return "bigint{$values['arrayValue']}" . $default; + } + /** * Return a datetime type-formatted string * For PostgreSQL, we simply return the word 'timestamp', no other parameters are necessary