Discussion:
[odb-users] sqlite ON UPDATE CASCADE
MM
2018-10-23 13:43:25 UTC
Permalink
Hello,

The sql generated by odb say for a member that is std::vector<T> includes a
foreign constraint "ON DELETE CASCADE" so that is the containing object is
deleted from the master table, the relevant rows are deleted from the slave
table.

Is there a pragma to generate "ON UPDATE CASCADE" as well?

Thank you
Boris Kolpackov
2018-10-24 12:42:36 UTC
Permalink
Post by MM
The sql generated by odb say for a member that is std::vector<T> includes a
foreign constraint "ON DELETE CASCADE" so that is the containing object is
deleted from the master table, the relevant rows are deleted from the slave
table.
Is there a pragma to generate "ON UPDATE CASCADE" as well?
No. This is normally unnecessary since the foreign key points to the
primary key (object id) which cannot be modified.

Loading...