Browse Source

Change binary column type to VARBINARY(MAX).

SQL Server binary columns have a maximum length of 8000 bytes. Varbinary columns also have a maximum length of 8000 bytes. Varbinary(MAX) columns support up to 2 GB.
Walther Lalk 12 years ago
parent
commit
050efd6eae

+ 1 - 1
src/Database/Schema/SqlserverSchema.php

@@ -291,7 +291,7 @@ class SqlserverSchema extends BaseSchema {
 			'integer' => ' INTEGER',
 			'biginteger' => ' BIGINT',
 			'boolean' => ' BIT',
-			'binary' => ' BINARY',
+			'binary' => ' VARBINARY(MAX)',
 			'float' => ' FLOAT',
 			'decimal' => ' DECIMAL',
 			'text' => ' NVARCHAR(MAX)',

+ 1 - 1
tests/TestCase/Database/Schema/SqlserverSchemaTest.php

@@ -489,7 +489,7 @@ SQL;
 			[
 				'img',
 				['type' => 'binary'],
-				'[img] BINARY'
+				'[img] VARBINARY(MAX)'
 			],
 			// Boolean
 			[