From: Mike Bayer Date: Sat, 11 Mar 2023 06:51:20 +0000 (-0500) Subject: fix unlengthed string used as pk X-Git-Tag: rel_2_0_6~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=85897db771bd3150d10ebb80cade909c69264ac0;p=thirdparty%2Fsqlalchemy%2Fsqlalchemy.git fix unlengthed string used as pk SQL Server has been failing on this test for a month as it does not allow a PK on VARCHAR(max) Change-Id: I3f43e660275e03ced1b584fe9d3c7f34f5558330 --- diff --git a/test/orm/inheritance/test_basic.py b/test/orm/inheritance/test_basic.py index 1a0fe1629e..99cfdc3837 100644 --- a/test/orm/inheritance/test_basic.py +++ b/test/orm/inheritance/test_basic.py @@ -4118,8 +4118,8 @@ class CompositeJoinedInTest(fixtures.DeclarativeMappedTest): class A(fixtures.ComparableEntity, Base): __tablename__ = "table_a" - order_id: Mapped[str] = mapped_column(primary_key=True) - _sku: Mapped[str] = mapped_column(primary_key=True) + order_id: Mapped[str] = mapped_column(String(50), primary_key=True) + _sku: Mapped[str] = mapped_column(String(50), primary_key=True) __mapper_args__ = { "polymorphic_identity": "a", @@ -4135,8 +4135,10 @@ class CompositeJoinedInTest(fixtures.DeclarativeMappedTest): class B(A): __tablename__ = "table_b" - _increment_id: Mapped[str] = mapped_column(primary_key=True) - _sku: Mapped[str] = mapped_column(primary_key=True) + _increment_id: Mapped[str] = mapped_column( + String(50), primary_key=True + ) + _sku: Mapped[str] = mapped_column(String(50), primary_key=True) __table_args__ = ( ForeignKeyConstraint(