]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commitdiff
fix unlengthed string used as pk
authorMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Mar 2023 06:51:20 +0000 (01:51 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 11 Mar 2023 06:51:20 +0000 (01:51 -0500)
SQL Server has been failing on this test for a month as it does
not allow a PK on VARCHAR(max)

Change-Id: I3f43e660275e03ced1b584fe9d3c7f34f5558330

test/orm/inheritance/test_basic.py

index 1a0fe1629e05fcb56b3a4b122d570fe6cdddc59c..99cfdc3837935c2bb8180990c6fd0e24b4cb0530 100644 (file)
@@ -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(