Export to GitHub

ruckusing - issue #3

MySQLTableDefinition does not handle disabled primary key correctly


Posted on Dec 9, 2007 by Massive Camel

class.MySQLTableDefinition.php line 29:

$pk_name = null; if(array_key_exists('id', $options) && $options['id'] != false) { if(array_key_exists('primary_key',$options)) { $pk_name = $options['primary_key']; } } else { //auto add primary key of "id" $pk_name = "id"; }

Should be:

$pk_name = null; if(array_key_exists('id', $options) && $options['id'] != false) { if(array_key_exists('primary_key', $options)) { $pk_name = $options['primary_key']; } else { // Auto add primary key of "id" $pk_name = 'id'; } }

Comment #1

Posted on Dec 10, 2007 by Massive Camel

Actually, it should be:

$pk_name = null; if(array_key_exists('id', $options)) { if($options['id'] != false) { if(array_key_exists('primary_key', $options)) { $pk_name = $options['primary_key']; } } } else { // Auto add primary key of "id" $pk_name = 'id'; }

Comment #2

Posted on Dec 21, 2007 by Swift Giraffe

Issue has been resolved and unit tested.

Thanks for your feedback!

Status: Verified

Labels:
Type-Defect Priority-Medium