EllisLab text mark
Advanced Search
     
Problem with multiple column non-primary keys in DBForge.
Posted: 13 December 2010 05:30 PM   [ Ignore ]
Joined: 2009-01-26
9 posts

According to the User guide I can use

$this->dbforge->add_key(array('blog_name''blog_label')); 

to create multiple column non-primary keys. I think there may be a misunderstanding somewhere because there is an if-block at the beginning of the add_key method that prevents multiple column non-primary keys. Removing the if-block

if (is_array($key))
        
{
            
foreach($key as $one)
            
{
                $this
->add_key($one$primary);
            
}
            
            
return;
        

makes the method perform exactly as I want it to. Without the if-block I can create indexes over multiple columns, with the if block my array of columns are added individually.

Also the commit that introduced the if says this, “Did a little clean up.  Nothing that affected functionality”

Am I using the forge wrong to make my compound indexes?