Commit 854a67da authored by Benjamin Eberlei's avatar Benjamin Eberlei

DBAL-197 - Add blob to registered mapping types and test on all platforms.

parent 32574598
...@@ -764,7 +764,7 @@ class MsSqlPlatform extends AbstractPlatform ...@@ -764,7 +764,7 @@ class MsSqlPlatform extends AbstractPlatform
'nvarchar' => 'string', 'nvarchar' => 'string',
'ntext' => 'text', 'ntext' => 'text',
'binary' => 'text', 'binary' => 'text',
'varbinary' => 'text', 'varbinary' => 'blob',
'image' => 'text', 'image' => 'text',
); );
} }
......
...@@ -679,6 +679,10 @@ class MySqlPlatform extends AbstractPlatform ...@@ -679,6 +679,10 @@ class MySqlPlatform extends AbstractPlatform
'decimal' => 'decimal', 'decimal' => 'decimal',
'numeric' => 'decimal', 'numeric' => 'decimal',
'year' => 'date', 'year' => 'date',
'longblob' => 'blob',
'blob' => 'blob',
'mediumblob' => 'blob',
'tinyblob' => 'blob',
); );
} }
......
...@@ -811,6 +811,7 @@ LEFT JOIN all_cons_columns r_cols ...@@ -811,6 +811,7 @@ LEFT JOIN all_cons_columns r_cols
'long raw' => 'text', 'long raw' => 'text',
'rowid' => 'string', 'rowid' => 'string',
'urowid' => 'string', 'urowid' => 'string',
'blob' => 'blob',
); );
} }
......
...@@ -767,6 +767,7 @@ class PostgreSqlPlatform extends AbstractPlatform ...@@ -767,6 +767,7 @@ class PostgreSqlPlatform extends AbstractPlatform
'money' => 'decimal', 'money' => 'decimal',
'numeric' => 'decimal', 'numeric' => 'decimal',
'year' => 'date', 'year' => 'date',
'bytea' => 'blob',
); );
} }
......
...@@ -479,6 +479,7 @@ class SqlitePlatform extends AbstractPlatform ...@@ -479,6 +479,7 @@ class SqlitePlatform extends AbstractPlatform
'real' => 'float', 'real' => 'float',
'decimal' => 'decimal', 'decimal' => 'decimal',
'numeric' => 'decimal', 'numeric' => 'decimal',
'blob' => 'blob',
); );
} }
......
...@@ -276,9 +276,8 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager ...@@ -276,9 +276,8 @@ class PostgreSqlSchemaManager extends AbstractSchemaManager
$precision = null; $precision = null;
$scale = null; $scale = null;
if ($this->_platform->hasDoctrineTypeMappingFor($tableColumn['type'])) {
$dbType = strtolower($tableColumn['type']); $dbType = strtolower($tableColumn['type']);
} else { if (strlen($tableColumn['domain_type'])) {
$dbType = strtolower($tableColumn['domain_type']); $dbType = strtolower($tableColumn['domain_type']);
$tableColumn['complete_type'] = $tableColumn['domain_complete_type']; $tableColumn['complete_type'] = $tableColumn['domain_complete_type'];
} }
......
...@@ -547,6 +547,20 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest ...@@ -547,6 +547,20 @@ class SchemaManagerFunctionalTestCase extends \Doctrine\Tests\DbalFunctionalTest
$this->assertInstanceOf('Doctrine\DBAL\Types\ArrayType', $columns['arr']->getType(), "The Doctrine2 should be detected from comment hint."); $this->assertInstanceOf('Doctrine\DBAL\Types\ArrayType', $columns['arr']->getType(), "The Doctrine2 should be detected from comment hint.");
} }
/**
* @group DBAL-197
*/
public function testListTableWithBlob()
{
$table = new \Doctrine\DBAL\Schema\Table('test_blob_table');
$table->addColumn('id', 'integer', array('comment' => 'This is a comment'));
$table->addColumn('binarydata', 'blob', array());
$table->setPrimaryKey(array('id'));
$this->_sm->createTable($table);
$blobTable = $this->_sm->listTableDetails('test_blob_table');
}
/** /**
* @param string $name * @param string $name
* @param array $data * @param array $data
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment