Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed multiple column non-primary keys in DB_forge. #937

Closed
wants to merge 1 commit into from

Conversation

harryxu
Copy link

@harryxu harryxu commented Jan 18, 2012

According to the User guide below code will generate a compound index.

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

But it generate two individual indexes.

This issue was also found in 2010.

http://codeigniter.com/forums/viewthread/175805/

@spajz
Copy link

spajz commented Jan 20, 2012

Hi!
I noticed the same thing.

@petsagouris
Copy link
Contributor

We also need to be able to specify a key name with that.

@MitchellMcKenna
Copy link

I can confirm this issue, it's a simple fix and I have tested that @harryxu's fix works.

@harryxu You may need to make this pull request against the develop branch for it to be accepted, currently it is against stable.

@petsagouris You do not need a way to specify a key name, it is noted in the documentation that it will combine the column names and put underscores between them.

@michaelbrooks
Copy link

Are we still waiting on this fix? It looks like @harryxu's fix won't work though, since it just removes the array handling code altogether.

@wyred
Copy link

wyred commented Oct 24, 2012

I just tested it and it doesn't work if I were to create a primary key that consists of more than 1 columns.
I ended up with "PRIMARY KEY Array (Array)" in the SQL

@narfbg
Copy link
Contributor

narfbg commented Nov 5, 2012

#1939

@narfbg narfbg closed this Nov 5, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants