framework icon indicating copy to clipboard operation
framework copied to clipboard

[Proposal] Methods for conditional database seeding

Open freezysko opened this issue 12 years ago • 3 comments

I would like to create methods allowing running seeds only when migrations were ran. It allows greater flexibility when developing in teams or you just need to run seeds only after some tables were created.

just like this

if ($this->isInLast('2014_03_13_010203_migration'))
{
    $this->call('TableSeeder');
}

I have done it in my forked branch freezy-sk/framework@733e796f42cef9a14b395d7634666b9675174316

freezysko avatar Mar 13 '14 17:03 freezysko

:clap: :thumbsup:

vavo avatar Mar 13 '14 18:03 vavo

Cool idea. I'd recommend more verbose method names, though. isInLast() in last what?

AkenRoberts avatar Mar 13 '14 20:03 AkenRoberts

Hmm, not sure I feel like this is a common enough scenario to warrant the maintenance. Maybe release your code as a Trait people can use on their seeders? Could put it on Packagist.

taylorotwell avatar Mar 13 '14 20:03 taylorotwell