SQLite Forum

3.31.1: create table with multiple primary key columns
Login
If data cannot be deleted then why have `on delete cascade`?  This basically means that if a site is deleted then all the child records associated with that site are deleted.  If you do not intend to delete data, then you should probably not use `on delete cascade` and probably want `on delete restrict`.  You can also use triggers to do this.  For example:


```
create trigger <name> before delete on <table>
begin
  select raise(ABORT, 'Cannot delete data');
end;
```

This means that even if there is an error in the application, it will not be able to delete records.  (Mind you, someone can still remove the trigger in order to allow deletions, but that requires intent to delete rather than mere accident).