Merge pull request #30 from ClaySolutions/master

Add bigint support
This commit is contained in:
Damian Mooyman 2015-02-25 08:52:57 +13:00
commit 1aeb7b1436
1 changed files with 26 additions and 0 deletions

View File

@ -1115,6 +1115,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