Skip to content

Commit fcedfc3

Browse files
committed
feat(backend): override create_schema_differ() to supply PostgresSchemaDiffer
The core migrated schema-diff resolution to the dependency-inversion hook SQLDialectBase.create_schema_differ() and no longer imports concrete backend differs. Override the hook so PostgreSQL keeps its specialized schema comparison in migration snapshot diffs. - Implement PostgresDialect.create_schema_differ() returning PostgresSchemaDiffer - Add changelog fragment
1 parent 6d43947 commit fcedfc3

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

‎changelog.d/55.added.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Added `PostgresDialect.create_schema_differ()` returning `PostgresSchemaDiffer` so the dialect exposes its schema comparison through the core's new dependency-inversion hook (`SQLDialectBase.create_schema_differ()`), keeping migration snapshot diffs correct now that the core no longer imports concrete backend differs.

‎src/rhosocial/activerecord/backend/impl/postgres/dialect.py‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,14 @@ def get_server_version(self) -> Tuple[int, int, int]:
640640
"""Return the PostgreSQL version this dialect is configured for."""
641641
return self.version
642642

643+
def create_schema_differ(self):
644+
"""Return the PostgreSQL schema differ for this dialect."""
645+
from rhosocial.activerecord.backend.impl.postgres.schema.differ import (
646+
PostgresSchemaDiffer,
647+
)
648+
649+
return PostgresSchemaDiffer()
650+
643651
def format_datetime_diff_expression(self, expr: "Any") -> Tuple[str, Tuple]:
644652
start_sql, start_params = expr.start.to_sql()
645653
end_sql, end_params = expr.end.to_sql()

0 commit comments

Comments
 (0)