FriendsOfDoctrine / dbal-clickhouse

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

new db, createSchema(), table computed doesn't exist. #33

Closed andrelec1 closed 4 years ago

andrelec1 commented 4 years ago

I try using a clickhouse and maria db in my symfony 4.4 project ...

i setup doctrine like this : config/packages/doctrine.yaml

doctrine:
    dbal:
        default_connection: maria
        connections:
            maria:
                url: '%env(resolve:DATABASE_URL)%'
                charset: utf8mb4
                default_table_options:
                    collate: utf8mb4_unicode_ci
            clickhouse:
                host:     '%env(resolve:CLICKHOUSE_URL)%'
                port:     '%env(resolve:CLICKHOUSE_PORT)%'
                user:     '%env(resolve:CLICKHOUSE_USER)%'
                password: '%env(resolve:CLICKHOUSE_PWD)%'
                dbname:   '%env(resolve:CLICKHOUSE_DBNAME)%'
                driver_class: FOD\DBALClickHouse\Driver
                wrapper_class: FOD\DBALClickHouse\Connection
                options:
                    enable_http_compression: 1
                    max_execution_time: 60
    orm:
        auto_generate_proxy_classes: true
        default_entity_manager: default
        entity_managers:
            default:
                connection: maria
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                auto_mapping: true
                mappings:
                    App:
                        is_bundle: false
                        type: staticphp
                        dir: '%kernel.project_dir%/src/Entity/'
                        prefix: 'App\Entity'
                        alias: App
            clickhouse:
                connection: clickhouse
                naming_strategy: doctrine.orm.naming_strategy.underscore_number_aware
                mappings:
                    App:
                        is_bundle: false
                        type: staticphp
                        dir: '%kernel.project_dir%/src/EntityClickhouse/'
                        prefix: 'App\EntityClickhouse'
                        alias: Clickhouse

Then i generate a Migration and i try to create a table following the Reame

but $fromSchema = $conn->getSchemaManager()->createSchema(); generate a error :

  [ClickHouseDB\Exception\DatabaseException (60)]        
  Table api_client.computed doesn't exist.               
  IN:DESCRIBE TABLE `api_client`.`computed` FORMAT JSON  

'api_client' is the dbname ( already created ). i didn't know why they look for 'computed' table ... ( this table didn't exist, the db is empty )