mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-30 13:10:47 +00:00
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:
parent
46d1f8bbb2
commit
89bb075ce6
1 changed files with 5 additions and 1 deletions
|
|
@ -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",
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue