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; }
/** * @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; }
/** * @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; }
/** * @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']}"; } }
/** * @see DBHelper::massageFieldDef() */ public function massageFieldDef(&$fieldDef, $tablename) { parent::massageFieldDef($fieldDef, $tablename); if ($fieldDef['type'] == 'bit') { $fieldDef['len'] = '1'; } }
/** * 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; }