My tables in Database (specific update and message Tables) are grown , and I can't remove old records(foreign key error)
what can I do ?
can I remove these Tables (update AND message )?
Updates table can be emptied without a problem, no foreign key errors there.
TRUNCATE telegram_update;
As for the others, you could just ignore the foreign key constraints and empty it.
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE message;
SET FOREIGN_KEY_CHECKS = 1;
@jacklul Any downside on doing this? Apart from the obvious links being broken?
No idea but editing message that was previously in database can result in constrain error in this case.
We might want to implement cleanup <days> command for this...
I have very similar command in one of my bots, If i don't forget I'll handle this!
Implemented in https://github.com/php-telegram-bot/core/pull/563
@mohsenshahab Check out the new /cleanup admin command in version 0.46.0 馃憤
Most helpful comment
No idea but editing message that was previously in database can result in constrain error in this case.
We might want to implement
cleanup <days>command for this...I have very similar command in one of my bots, If i don't forget I'll handle this!