Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Foreign key on myisam table alternative?

Tags:

sql

mysql

I am working on a website that need to use foreign keys, but I have searched all around and shared host doesn't support innoDB. I am using MyISAM engine. Is there an alternative for using foreign keys?

What I need:

table_image {
image_id (PK) 
}

table_ratings {
rating_id(PK) 
image_id(FK) 
}

Thanks in advance.

like image 832
wtsang02 Avatar asked Nov 04 '22 23:11

wtsang02


1 Answers

I struggled the hell before I fortunately switched to innoDb myself.

I had implemented all the inserts/delete cascade logic with a bunch of online/batch scripts...

But it might be ok actually, because in some very special situation you can disconnect cascade operations which is not always a bad idea reguarding to performances.

rgds.

like image 178
Sebas Avatar answered Nov 15 '22 06:11

Sebas