From a6267ac1faabd82b1928877744fc04d9618f28fa Mon Sep 17 00:00:00 2001 From: Goffi Date: Wed, 1 Sep 2021 15:25:02 +0200 Subject: [PATCH] core (memory/sql_mapping): remove autoincrement: SQLite specific behaviour with autoincrement (https://sqlite.org/autoinc.html) is actually already handled by SQLAlchemy, and unsetting autoincrement cause troubles when storing new objects. --- sat/memory/sqla_mapping.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/sat/memory/sqla_mapping.py b/sat/memory/sqla_mapping.py index b7ab1ce8..96d99f8e 100644 --- a/sat/memory/sqla_mapping.py +++ b/sat/memory/sqla_mapping.py @@ -151,9 +151,6 @@ class Profile(Base): Integer, primary_key=True, nullable=True, - # settings autoincrement would have negative performance impact - # cf. https://sqlite.org/autoinc.html - autoincrement=False ) name = Column(Text, unique=True) @@ -316,8 +313,6 @@ class Message(Base): id = Column( Integer, primary_key=True, - # cf. note for Profile.id - autoincrement=False ) history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) message = Column(Text) @@ -339,8 +334,6 @@ class Subject(Base): id = Column( Integer, primary_key=True, - # cf. note for Profile.id - autoincrement=False, ) history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) subject = Column(Text) @@ -362,8 +355,6 @@ class Thread(Base): id = Column( Integer, primary_key=True, - # cf. note for Profile.id - autoincrement=False, ) history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) thread_id = Column(Text)