-
Notifications
You must be signed in to change notification settings - Fork 3
Cleanup stale events in the DB (#361) #388
base: master
Are you sure you want to change the base?
Conversation
@rdmitr unfortunately this does not work - there's a missing "ON DELETE CASCADE" on the Unfortunately to add this I think we need to inside a transaction rename the existing payments table and create a new one. I think we also don't need to delete the I will pick this up. |
this does not sounds like what we want to do. esp. not on an open DB that is in use. then remove that foreign key constraint. I don't think it's necessarily good to have this on the DB level here? |
It wouldn't be on an open DB, it would be a new database migration that runs on startup.
That could be another option. But I don't think SQLite supports dropping constraints (e.g.
|
I don't think creating new tables and moving data over on bootup is a good practice. I also have never heard about this and the need for this. |
@bumi unfortunately, sqlite explicitly does not support altering constraints (https://sqlite.org/omitted.html):
Looks like the workaround Roland mentioned is the only way to go if we are to change the constraint. However, we anticipate that those tables can be large. Such a migration on a slow machine (like Raspberry Pi) can be quite slow. But then again, do we have a lot of active users of the app? If we go forward with this migration, will it affect a lot of people? If not, should we give it a try? Or maybe even change the original database schema so that all new installations get proper DB? |
Fixes getAlby/hub#87