소스 검색

Fix missing doctrine types

jmontoyaa 9 년 전
부모
커밋
33bf07fdf7
1개의 변경된 파일11개의 추가작업 그리고 0개의 파일을 삭제
  1. 11 0
      bin/doctrine.php

+ 11 - 0
bin/doctrine.php

@@ -18,6 +18,7 @@
 
 use Doctrine\ORM\Tools\Console\ConsoleRunner;
 use Symfony\Component\Console\Helper\HelperSet;
+use Doctrine\DBAL\Types\Type;
 
 (@include_once __DIR__ . '/../vendor/autoload.php') || @include_once __DIR__ . '/../../../autoload.php';
 
@@ -42,6 +43,16 @@ if ( ! is_readable($configFile)) {
     exit(1);
 }
 
+Type::overrideType(
+    Type::DATETIME,
+    Database::getUTCDateTimeTypeClass()
+);
+
+Type::addType(
+    'json',
+    'Sonata\Doctrine\Types\JsonType'
+);
+
 $commands = array(
     new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
     new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),