From 3f8849e88893c4b155f72d4b4a7e54c609294a6c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Steffen=20M=C3=BCthing?= Date: Thu, 26 May 2022 14:03:48 +0200 Subject: [PATCH] Forward autoincrement property from field to column The autoincrement property of ormar fields did not get propagated to the SQLAlchemy column definition. As a result, the autoincrement property of the SQLAlchemy column defaulted to `auto`, making it impossible to create DDL that did not auto-increment the database column. --- ormar/fields/base.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ormar/fields/base.py b/ormar/fields/base.py index f7eaff5c5..88096bd93 100644 --- a/ormar/fields/base.py +++ b/ormar/fields/base.py @@ -268,6 +268,7 @@ def get_column(self, name: str) -> sqlalchemy.Column: self.column_type, *self.construct_constraints(), primary_key=self.primary_key, + autoincrement=self.autoincrement, nullable=self.sql_nullable, index=self.index, unique=self.unique,