Foreign key and model relation - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: Model-View-Controller (https://forum.codeigniter.com/forumdisplay.php?fid=10) +--- Thread: Foreign key and model relation (/showthread.php?tid=71174) |
Foreign key and model relation - Jyothigowda - 07-15-2018 How to add foreign key in table in table migration and hoe to do model relation? RE: Foreign key and model relation - scalla - 07-16-2018 Try this This works with new table PHP Code: $this->dbforge->add_field('CONSTRAINT FOREIGN KEY (id) REFERENCES table(id)'); PHP Code: $this->dbforge->add_column('table',[ |