Browsing All posts tagged under »Database«

Foreign key relations in MySql – Avoiding accidental deletion of posts

July 7, 2009

1

The normal case when using foreign key relationships in database tables might be “ON DELETE CASCADE ON UPDATE CASCADE”. If you have a table connecting a user_id to an activity_id, this means that deleting the activity post also deletes the connection post. Fine! The activity is gone, and so the table post defining the connection… [Read more…]

Setting up foreign key relations in MySql databases

July 7, 2009

0

When using the InnoDB table format in MySql, there’s the possibility to define foreign key relations to guarantee referential integrity. Setting up the relations by using “ALTER TABLE” sql statements is not that trivial though. I had some struggles the other day… Luckily there’s a view in PhpMyAdmin that takes care of this. Check out… [Read more…]

Follow

Get every new post delivered to your Inbox.