示例#1
0
 public function testGetColumnTypeMSSql()
 {
     $_helper = new MssqlHelper();
     $this->assertEquals("decimal(26,6)", $_helper->getColumnType("currency"));
     $this->assertEquals("Unknown", $_helper->getColumnType("Unknown"));
     unset($_helper);
 }
 /**
  * @see DBHelper::getColumnType()
  */
 public function getColumnType($type, $name = '', $table = '')
 {
     $columnType = parent::getColumnType($type, $name, $table);
     if (in_array($columnType, array('char', 'varchar'))) {
         $columnType = 'n' . $columnType;
     }
     return $columnType;
 }
示例#3
0
 /**
  * @see DBHelper::getColumnType()
  */
 public function getColumnType($type, $name = '', $table = '')
 {
     $columnType = parent::getColumnType($type, $name, $table);
     if (in_array($columnType, array('char', 'varchar'))) {
         $columnType = 'n' . $columnType;
     }
     // Use varbinary field for storage of text and blob field types
     //if ( in_array($columnType,array('ntext','text','image')) )
     //    $columnType = 'varbinary(max)';
     return $columnType;
 }
示例#4
0
 /**
  * @see DBHelper::getColumnType()
  */
 public function getColumnType($type, $name = '', $table = '')
 {
     $columnType = parent::getColumnType($type, $name, $table);
     // Bug 30184 - Comment out this code for the time being until we have better UTF-8 support in the driver
     //if ( in_array($columnType,array('char','varchar')) )
     //	$columnType = 'n'.$columnType;
     // Bug 30876 - Comment out this code for the time being until we have better UTF-8 support in the driver
     // Use varbinary field for storage of text and blob field types
     //if ( in_array($columnType,array('ntext','text','image')) )
     //    $columnType = 'varbinary';
     return $columnType;
 }
示例#5
0
 /**
  * @see DBHelper::oneColumnSQLRep()
  */
 protected function oneColumnSQLRep($fieldDef, $ignoreRequired = false, $table = '', $return_as_array = false)
 {
     $ref = parent::oneColumnSQLRep($fieldDef, $ignoreRequired, $table, true);
     if ($ref['colType'] == 'nvarchar' || $ref['colType'] == 'nchar') {
         if (!empty($fieldDef['len'])) {
             $ref['colType'] .= "(" . $fieldDef['len'] . ")";
         } else {
             $ref['colType'] .= "(255)";
         }
     }
     if ($return_as_array) {
         return $ref;
     } else {
         return "{$ref['name']} {$ref['colType']} {$ref['default']} {$ref['required']} {$ref['auto_increment']}";
     }
 }
示例#6
0
 /**
  * @see DBHelper::massageFieldDef()
  */
 public function massageFieldDef(&$fieldDef, $tablename)
 {
     parent::massageFieldDef($fieldDef, $tablename);
     if ($fieldDef['type'] == 'bit') {
         $fieldDef['len'] = '1';
     }
 }
示例#7
0
 /**
  * Override method to add support for detecting and dropping fulltext indices.
  *
  * @see DBHelper::changeColumnSQL()
  * @see MssqlHelper::changeColumnSQL()
  */
 protected function changeColumnSQL($tablename, $fieldDefs, $action, $ignoreRequired = false)
 {
     $sql = '';
     if ($this->doesTableHaveAFulltextIndexDefined($tablename)) {
         $sql .= "DROP FULLTEXT INDEX ON {$tablename}";
     }
     $sql .= parent::changeColumnSQL($tablename, $fieldDefs, $action, $ignoreRequired);
     return $sql;
 }