wallet: add comment on db noting that ON DELETE CASCADE is never used.

We actually have an assertion that there are no channels remaining when
we delete peers, so this is confusing!

Actually removing the constraint is db-specific and deeply non-trivial.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell 2023-03-20 10:44:35 +10:30
parent 7d7b2abd02
commit 98d425f1f4

View file

@ -96,6 +96,8 @@ static struct migration dbmigrations[] = {
NULL},
{SQL("CREATE TABLE channels ("
" id BIGSERIAL," /* chan->id */
/* FIXME: We deliberately never delete a peer with channels, so this constraint is
* unnecessary! */
" peer_id BIGINT REFERENCES peers(id) ON DELETE CASCADE,"
" short_channel_id TEXT,"
" channel_config_local BIGINT,"