Skip to content

Commit

Permalink
Dev MSSQL breaks on Active Record when column has a default value of …
Browse files Browse the repository at this point in the history
…NULL - see yiisoft/yii#842
  • Loading branch information
c-schmitz committed Jun 19, 2012
1 parent 7d8f0cb commit 44831d2
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions framework/db/schema/mssql/CMssqlColumnSchema.php
Expand Up @@ -19,6 +19,24 @@
*/
class CMssqlColumnSchema extends CDbColumnSchema
{



/**
* Initializes the column with its DB type and default value.
* This sets up the column's PHP type, size, precision, scale as well as default value.
* @param string $dbType the column's DB type
* @param mixed $defaultValue the default value
*/
public function init($dbType, $defaultValue)
{
if ($defaultValue=='(NULL)')
{
$defaultValue=null;
}
parent::init($dbType, $defaultValue);
}

/**
* Extracts the PHP type from DB type.
* @param string $dbType DB type
Expand Down

0 comments on commit 44831d2

Please sign in to comment.