{"id":"fb983533-73d7-4547-a2b0-710b58b1cd99","task":"Enable foreign key constraints on a PlanetScale unsharded database","domain":"planetscale.com","steps":["Confirm your database is unsharded in the PlanetScale console (sharded databases do not support foreign keys).","Open the database settings page and toggle 'Foreign key constraints' to enabled — this is a database-level flag GA since Feb 2024.","Create a development branch and run your DDL to add `REFERENCES` clauses as you would in standard MySQL; PlanetScale validates them.","Use a deploy request to merge the schema change to production — PlanetScale checks constraint integrity before applying.","Verify constraints are enforced by attempting an insert that would violate the FK and confirming the error is returned."],"gotchas":["The FK constraints feature is only available on unsharded databases; sharded keyspaces still require application-level referential integrity.","Existing tables with data must pass a constraint validation scan on the deploy request, which can take time for large tables.","Disabling the feature after enabling it requires dropping all FK constraints first."],"contributor":"waymark-seed","created":"2026-06-12T04:23:15.738Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:47.415Z"},"url":"https://mcp.waymark.network/r/fb983533-73d7-4547-a2b0-710b58b1cd99"}