FriendsOfDoctrine / dbal-clickhouse

Doctrine DBAL driver for ClickHouse database
GNU General Public License v3.0
98 stars 82 forks source link

Detect PK in MergeTree table fails #16

Closed demenkov closed 6 years ago

demenkov commented 6 years ago

When I'm trying to create mapping from table in MergeTree by command

php bin/console doctrine:mapping:import App\\Entity xml --path=config/doctrine --em=clickhouse

it returns following

In DatabaseDriver.php line 288:

  Table stat has no primary key. Doctrine does not support reverse engineering from tables that  
   don't have a primary key.                 
argayash commented 6 years ago

@demenkov Can you check with new release v.1.5.1?

demenkov commented 6 years ago

@argayash yep, generated normally

demenkov commented 6 years ago

I think I found a bug related to https://github.com/FriendsOfDoctrine/dbal-clickhouse/pull/15 When generated annotation for column with nullable type utm_source Nullable(String) importer creates description of field with nullable=false instead of nullable=true <field name="utmSource" type="string" column="utm_source" nullable="false">

argayash commented 6 years ago

@demenkov Can you check with new release v.1.5.2?)

demenkov commented 6 years ago

@mochalygin yep, works correct)