Seeder on migration - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=31) +--- Thread: Seeder on migration (/showthread.php?tid=77293) |
Seeder on migration - pippuccio76 - 08-12-2020 Can i insert multiple row while run migration ? For example i have a class PopulateUserState with a run method : PHP Code: public function run() Can i launch this method on migration ? Other answer , how can i add pultiple row on seeder run ? RE: Seeder on migration - InsiteFX - 08-12-2020 You would need to do a insertBatch. PHP Code: $this->db->table('blog')->insertBatch([ You may also be able to use a foreach loop if you need to input lots of data from a file or something. |