Skip to content

Commit

Permalink
Implement more complete support for comments
Browse files Browse the repository at this point in the history
  • Loading branch information
gordthompson authored and rafiss committed Sep 12, 2024
1 parent 48a4c3c commit 2ba81ad
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions sqlalchemy_cockroachdb/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,10 @@ class CockroachDBImpl(alembic.ddl.postgresql.PostgresqlImpl):
def visit_column_type(*args, **kwargs):
return alembic.ddl.postgresql.visit_column_type(*args, **kwargs)

@compiles(alembic.ddl.postgresql.ColumnComment, "cockroachdb")
def visit_column_comment(*args, **kwargs):
return alembic.ddl.postgresql.visit_column_comment(*args, **kwargs)


# If sqlalchemy-migrate is installed, register there too.
try:
Expand Down
10 changes: 6 additions & 4 deletions test/test_suite_alembic.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ def test_existing_table_comment_no_change(self):
def test_remove_column_comment(self):
pass

@skip("cockroachdb")
def test_remove_table_comment(self):
pass


class AutogenerateComputedTest(_AutogenerateComputedTest):
@skip("cockroachdb")
def test_add_computed_column(self):
if not (
config.db.dialect.driver == "asyncpg" and not config.db.dialect._is_v231plus
):
super().test_add_computed_column()
pass

@skip("cockroachdb")
def test_cant_change_computed_warning(self):
Expand Down

0 comments on commit 2ba81ad

Please sign in to comment.