mirror of
https://github.com/TitanEmbeds/Titan.git
synced 2024-12-23 21:47:04 +01:00
Fix issue of offset and delete
Sqlalchemy doesnt like it, idk y attempt fix again
This commit is contained in:
parent
44af174287
commit
fc7e74cbe3
@ -478,7 +478,9 @@ def cleanup_keyval_db():
|
||||
continue
|
||||
for channel in channelsjson:
|
||||
chanid = channel["id"]
|
||||
db.session.query(Messages).filter(Messages.channel_id == chanid).order_by(Messages.timestamp.desc()).offset(50).delete()
|
||||
msgs = db.session.query(Messages).filter(Messages.channel_id == chanid).order_by(Messages.timestamp.desc()).offset(50).all()
|
||||
for msg in msgs:
|
||||
db.session.delete(msg)
|
||||
db.session.commit()
|
||||
|
||||
return ('', 204)
|
||||
|
Loading…
Reference in New Issue
Block a user