Merge pull request #178 from fhteam/master_custom_types_support

Custom database types support for L5 branch
This commit is contained in:
Barry vd. Heuvel
2015-05-06 12:02:57 +02:00
2 changed files with 39 additions and 2 deletions
+8 -1
View File
@@ -217,7 +217,14 @@ class ModelsCommand extends Command
{
$table = $model->getConnection()->getTablePrefix() . $model->getTable();
$schema = $model->getConnection()->getDoctrineSchemaManager($table);
$schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
$databasePlatform = $schema->getDatabasePlatform();
$databasePlatform->registerDoctrineTypeMapping('enum', 'string');
$platformName = $databasePlatform->getName();
$customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", array());
foreach ($customTypes as $yourTypeName => $doctrineTypeName) {
$databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
}
$columns = $schema->listTableColumns($table);