Question on Delete Cascade

I’ve got a database with a number of tables. When a row in one gets deleted it should cascade to one or more others. Some of these links work, others don’t.

One table includes the reference

  • "foreign key (CompetitionCode, FixtureDate, HomeTeam) " _
  • “references Fixtures (CompetitionCode, FixtureDate, HomeTeam) on delete cascade)”)

When I delete the row in Fixtures it goes but the 3 rows in this table remain. I have checked that the reference keys all match.
The references that do work as expected all use a single column as reference; is what I’m trying to do valid?
I should have said this is SQLITE, running on a MAC.

Thanks for any advice.

By default, SQLite foreign key support is disabled. You have to enable it in your code by using the pragma statement.

pragma foreign_keys=1;

This only needs to be done once for a given connection.

Idiot that I am.
I knew that … and forgot. Now working as intended.

Thanks for the reminder.