FriendsOfDoctrine / dbal-clickhouse

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

Error after CH upgrade from 2.6 to 2.7 #49

Open Gamulator opened 2 years ago

Gamulator commented 2 years ago

Hi. While doing migrations (Symfony5) and perform table creation I get now:

HttpCode:500 ; ;Code: 36. DB::Exception: This syntax for *MergeTree engine is deprecated. Use extended storage definition syntax with ORDER BY/PRIMARY KEY clause.See
also allow_deprecated_syntax_for_merge_tree setting. (BAD_ARGUMENTS) (version 22.7.2.15 (official build))

Gamulator commented 1 year ago

Works if create queries manually with new syntax:

    $this->connection->executeQuery("
            CREATE TABLE logs
            (
                `EventDate` Date DEFAULT today(),
                `id` UUID,
                `data` String,
                `createdAt` DateTime
            )
            ENGINE = ReplacingMergeTree
            ORDER BY (id)
            PARTITION BY toYYYYMM(EventDate)
            SETTINGS index_granularity = 8192
        ");
asanikovich commented 1 year ago

@Gamulator please provide a repository with example of bug.

gempir commented 9 months ago

I can reproduce the bug.

I use the ORM to generate a create statement for me.

CREATE TABLE offer_price_history (EventDate Date DEFAULT today(), id String, price Int32) ENGINE = ReplacingMergeTree(EventDate, (id), 8192);```

And it errors

This syntax for *MergeTree engine is deprecated. Use extended storage definition syntax with ORDER BY/PRIMARY KEY clause. See also `allow_deprecated_syntax_for_merge_tree` setting. (BAD_ARGUMENTS)
  IN:CREATE TABLE offer_price_history (EventDate Date DEFAULT today(), id String, price Int32) ENGINE = ReplacingMergeTree(EventDate, (id), 8192)

Clickhouse Version: (version 23.9.1.1854 (official build))