Welcome Guest, Not a member yet? Register   Sign In
Seeder on migration
#1

Can i insert multiple row while run migration ? 
For example i have a class PopulateUserState

with a run method :

PHP Code:
        public function run()
        {
                $data = [
                        'stato' => 'Da confermare',
                        'atttivo'    => 1
                
];

                // Simple Queries
                $this->db->query("INSERT INTO stato_users (stato, attivo) VALUES(:stato:, :attivo:)",
                        $data
                
);

                // Using Query Builder
                $this->db->table('stato_users')->insert($data);
        }


Can i launch this method on migration ?

Other answer , how can i add pultiple row on seeder run ?
Reply


Messages In This Thread
Seeder on migration - by pippuccio76 - 08-12-2020, 10:55 AM
RE: Seeder on migration - by InsiteFX - 08-12-2020, 11:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB