Welcome Guest, Not a member yet? Register   Sign In
How to add FOREIGN KEY constraint when creating a table?
#8

[eluser]mabasic[/eluser]
[quote author="Aken" date="1366442675"]Your code will only work for the mysqli DB driver. It'll effectively break DB forge on any other driver, because you've changed the parameters in the call to _create_table(), but not the actual parameters in each driver.

If you have suggestions for foreign keys in the forge, you should contribute to this pull request's discussion to encourage activity on the subject, and work towards a solution that supports as many DBs as possible.[/quote]

Yes, I have forgotton to mention that this only works with mysqli DB driver, as it is the one that I am using.
I have seen that discussion and tried the code, but with no success. If you want to have foreign keys support on different DB drivers, then You should implement that, I have no desire to work on something that I don't need.

The reason why i didn't do a pull request is because I have branched the stable branch not the develop branch as stated in the codeigniter guidelines.

This solution requires only a few changes to two files in the system folder and it is very simple to use.

I hope that it will help someone who stumbles upon this post as me.


Messages In This Thread
How to add FOREIGN KEY constraint when creating a table? - by El Forum - 04-20-2013, 01:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB