Welcome Guest, Not a member yet? Register   Sign In
Problem with multiple column non-primary keys in DBForge.
#1

[eluser]davido[/eluser]
According to the User guide I can use
Code:
$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
Code:
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?




Theme © iAndrew 2016 - Forum software by © MyBB