clickhouse-sqlalchemy icon indicating copy to clipboard operation
clickhouse-sqlalchemy copied to clipboard

clickhouse_after on Column should not affect CREATE TABLE statements

Open AntonFriberg opened this issue 2 years ago • 0 comments

Describe the bug When specifying clickhouse_after keyword argument in a Column it should not affect table creation since AFTER statements are not allowed in CREATE TABLE statements.

It might seem strange to even have clickhouse_after specified at all in Columns for Table specification but it would make it a lot easier to maintain SQLalchemy models together with Alembic for automatic migration generation.

To Reproduce

This works

CREATE TABLE test_table
(
    x1 Int8,
    x2 Int8
)
engine = Memory

This does not

CREATE TABLE test_table
(
    x1 Int8,
    x2 Int8 AFTER x1
)
engine = Memory

Expected behavior AFTER <column> clause would be ignored for CREATE TABLE constructs.

Versions

  • Latest master clickhouse-sqlalchemy @ git+https://github.com/xzkostyan/clickhouse-sqlalchemy@8787870ba3f146027bde46bf1a18332ead726187
  • Python version. Python 3.10.1

I will provide a simple fix in PR.

AntonFriberg avatar Nov 22 '22 09:11 AntonFriberg