comparison sat/memory/sqla_mapping.py @ 3639:05db744f194f

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.
author Goffi <goffi@goffi.org>
date Wed, 01 Sep 2021 15:25:02 +0200
parents cb8d0e8b917f
children 162866ca4be7
comparison
equal deleted inserted replaced
3638:257135d5c5c2 3639:05db744f194f
149 149
150 id = Column( 150 id = Column(
151 Integer, 151 Integer,
152 primary_key=True, 152 primary_key=True,
153 nullable=True, 153 nullable=True,
154 # settings autoincrement would have negative performance impact
155 # cf. https://sqlite.org/autoinc.html
156 autoincrement=False
157 ) 154 )
158 name = Column(Text, unique=True) 155 name = Column(Text, unique=True)
159 156
160 params = relationship("ParamInd", back_populates="profile", passive_deletes=True) 157 params = relationship("ParamInd", back_populates="profile", passive_deletes=True)
161 private_data = relationship( 158 private_data = relationship(
314 ) 311 )
315 312
316 id = Column( 313 id = Column(
317 Integer, 314 Integer,
318 primary_key=True, 315 primary_key=True,
319 # cf. note for Profile.id
320 autoincrement=False
321 ) 316 )
322 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) 317 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE"))
323 message = Column(Text) 318 message = Column(Text)
324 language = Column(Text) 319 language = Column(Text)
325 320
337 ) 332 )
338 333
339 id = Column( 334 id = Column(
340 Integer, 335 Integer,
341 primary_key=True, 336 primary_key=True,
342 # cf. note for Profile.id
343 autoincrement=False,
344 ) 337 )
345 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) 338 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE"))
346 subject = Column(Text) 339 subject = Column(Text)
347 language = Column(Text) 340 language = Column(Text)
348 341
360 ) 353 )
361 354
362 id = Column( 355 id = Column(
363 Integer, 356 Integer,
364 primary_key=True, 357 primary_key=True,
365 # cf. note for Profile.id
366 autoincrement=False,
367 ) 358 )
368 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE")) 359 history_uid = Column(ForeignKey("history.uid", ondelete="CASCADE"))
369 thread_id = Column(Text) 360 thread_id = Column(Text)
370 parent_id = Column(Text) 361 parent_id = Column(Text)
371 362