mirror of
https://github.com/aljazceru/lightning.git
synced 2026-01-30 11:14:20 +01:00
plugins/sql: fix foreign keys.
I noticed that our subtables were not being cleaned, despite being "ON DELETE CASCADE". This is because foreign keys were not enabled, but then I got foreign key errors: rowid cannot be a foreign key anyway! So create a real "rowid" column. We want "ON DELETE CASCADE" for nodes and channels (and other tables in future) where we update partially. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
committed by
Alex Myers
parent
3dde1ca399
commit
f87c7ed439
@@ -80,6 +80,12 @@ Additionally, only the following functions are allowed:
|
||||
|
||||
TABLES
|
||||
------
|
||||
Note that the first column of every table is a unique integer called
|
||||
`rowid`: this is used for related tables to refer to specific rows in
|
||||
their parent. sqlite3 usually has this as an implicit column, but we
|
||||
make it explicit as the implicit version is not allowed to be used as
|
||||
a foreign key.
|
||||
|
||||
[comment]: # (GENERATE-DOC-START)
|
||||
The following tables are currently supported:
|
||||
- `bkpr_accountevents` (see lightning-bkpr-listaccountevents(7))
|
||||
|
||||
Reference in New Issue
Block a user