Foreign keys · Cloudflare D1 docs
PRAGMA defer_foreign_keys = true
- draft docs: https://silverlock-d1-foreign-keys.cloudflare-docs-7ou.pages.dev/d1/learning/foreign-keys/#relax-foreign-key-constraintsForeign keys · Cloudflare D1 docs
D1 supports defining and enforcing foreign key constraints across tables in a database.
1 Reply
Hey Matt, do I need to do anything in order to get defer_foreign_keys to work? I'm running
"wrangler": "^3.28.4"
and attempting to add PRAGMA defer_foreign_keys = true
in my migration and I'm hitting an internal error.
OH! OK nice, I just wasn't ressing the value back to OFF which is why I was hitting the internal error.
It worked!