I'm asked to add a new role to existing live system developed in Laravel 5.2. We already have RoleSeeder
. But if I add a new entry to RoleSeeder
, I can't just run php artisan db:seed --class=RoleSeeder
since it will try to recreate the other roles. What is the expected way to incrementally add new record to seeder?
Asked
Active
Viewed 464 times
0

DarkVenture
- 65
- 10
1 Answers
1
yup you cant just add new roles in your RoleSeeder coz when you re-run the RoleSeeder it will seed all the data, so the solution is to create new seeder (RoleSeeder2) in your to seed new roles to your table

cresjie
- 469
- 2
- 13
-
Any other way to do this without creating another seeder class? I'll have to maintain multiple seeders then. – DarkVenture Oct 21 '16 at 02:47
-
currently nope, coz there's no tracking for what data are seeded and what data is not yet on the table. so in short, you need to manage the seeders/seeding by yourself, that could be multiple seeders. i feel you man, wew – cresjie Oct 21 '16 at 03:00