⚠ In case you've missed it we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This forum is read-only and soon will be archived. ⚠

How To Delete the Foreign Key Constraints in the Database

Delete Foreign Key Update Database Relations

  • Please log in to reply
1 reply to this topic

#1 Venkatesh Waran

Venkatesh Waran


  • Members
  • Pip
  • 1 posts

Posted 04 December 2014 - 07:10 AM

When I delete a record in the database. It shows result as  "Cannot delete or update a parent row: a foreign key constraint fails". How can I delete  a record with foreign key constraints. Is There any CRUD code for this issue...



Thanks in advance...

#2 Amit Shah

Amit Shah

    grocery CRUD Master

  • Advanced Member
  • PipPipPip
  • 1,192 posts

Posted 08 December 2014 - 03:52 AM

well u can use callback_before_delete

there u can write your code to delete it

Also tagged with one or more of these keywords: Delete, Foreign Key, Update, Database, Relations

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users