Keep the age-band unique constraint within Postgres's 63-char limit 🟩

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-06-19 13:52:28 +00:00
parent 46d1f8bbb2
commit 89bb075ce6

View file

@ -23,10 +23,14 @@ from infrastructure.postgres.landlord_override_enums import override_source_sa_e
class LandlordConstructionAgeBandOverrideRow(SQLModel, table=True): class LandlordConstructionAgeBandOverrideRow(SQLModel, table=True):
__tablename__: ClassVar[str] = "landlord_construction_age_band_overrides" # pyright: ignore[reportIncompatibleVariableOverride] __tablename__: ClassVar[str] = "landlord_construction_age_band_overrides" # pyright: ignore[reportIncompatibleVariableOverride]
__table_args__: ClassVar[tuple[UniqueConstraint, ...]] = ( # pyright: ignore[reportIncompatibleVariableOverride] __table_args__: ClassVar[tuple[UniqueConstraint, ...]] = ( # pyright: ignore[reportIncompatibleVariableOverride]
# NB: shortened (drop the redundant ``_overrides``) to stay within
# PostgreSQL's 63-char identifier limit -- the full
# ``landlord_construction_age_band_overrides_portfolio_description_unique``
# is 68 chars and would be silently truncated, diverging from Drizzle.
UniqueConstraint( UniqueConstraint(
"portfolio_id", "portfolio_id",
"description", "description",
name="landlord_construction_age_band_overrides_portfolio_description_unique", name="landlord_construction_age_band_portfolio_description_unique",
), ),
) )