Skip to content
Permalink
Browse files

Cast length/precision/scale to integers in SQLServer

Schema reflection would leave length as a string when it should be an
integer. The same was true for precision and scale.

Refs #11296
  • Loading branch information...
markstory committed Oct 8, 2017
1 parent 8827866 commit 8bc332debd40452483fb75b6cd280b348b268736
@@ -81,6 +81,10 @@ public function describeColumnSql($tableName, $config)
protected function _convertColumn($col, $length = null, $precision = null, $scale = null)
{
$col = strtolower($col);
$length = (int)$length;
$precision = (int)$precision;
$scale = (int)$scale;
if (in_array($col, ['date', 'time'])) {
return ['type' => $col, 'length' => null];
}
@@ -408,7 +408,7 @@ public function testDescribeTable()
];
$this->assertEquals(['id'], $result->primaryKey());
foreach ($expected as $field => $definition) {
$this->assertEquals($definition, $result->column($field), 'Failed to match field ' . $field);
$this->assertSame($definition, $result->column($field), 'Failed to match field ' . $field);
}
}

0 comments on commit 8bc332d

Please sign in to comment.
You can’t perform that action at this time.