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

[eluser]mabasic[/eluser]
Hi all,

I was inspired by the posts here and frustrated by codeigniter that it does not have abillity to add foreign keys using DBforge so I forked the repo and added it as a new feature. It only requires little code modifications to system folder.

You can find the code here: https://github.com/DamexHr/CodeIgniter/t...reign_key/

Usage is simple
Code:
$this->dbforge->add_foreign_key(array('field' => 'language_id',
               'foreign_table' => 'languages',
               'foreign_field' => 'id'));


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



Theme © iAndrew 2016 - Forum software by © MyBB