php - MySQL InnoDB auto increment column based on combination of other columns -


i making system users can upload file want, , not use execute kind of code. part of that, rename every file, , store original name in mysql table. table contains id of user uploaded it, , unique id of upload. doing this:

create table `uploads` (     `user_id` int(11) not null,     `upload_id` int(11) not null auto_increment,     `original_name` varchar(30) not null,     `mime_type` varchar(30) not null,     `name` varchar(50) not null,     primary key (`user_id`, `upload_id`) ) engine=myisam; 

this means have unique combination of user_id , upload_id, , every users first upload has id of 1. heard myisam old, , should rather use innodb. there way can achieve in innodb?

the biggest problem myisam tables not transactional. say, creating records , reading them (possibly deleting them later) there little or no editing. situation myisam designed for, fast read records. see no advantage converting innodb.


Comments

Popular posts from this blog

javascript - How to process users in one specific order using map o each function? -

javascript - Linking from page A to a specific iframe on page B -

java - Two interface have same method name with different return type -