composer require sonrac/symfony-seed-command
The package is designed to fill the database with data bypassing migrations.
Add to console application command sonrac\SeedCommand
, as example, for silex:
$app->add(new sonrac\SimpleSeed\SeedCommand(null, $app->get('db')));
Seed class must be implement sonrac\SimpleSeed\SeedInterface
sonrac\SimpleSeed\SimpleSeed
Simple seed for data insert. Define getTable
for table name and getData
for get data.
Insert would be run automatically
sonrac\SimpleSeed\SimpleSeedWithCheckExists
Seed with check exists inserted data before insert.
Define getTable
for table name and getData
for get data. Also, define getWhereForRow
which is where filter for select data
before insert
Insert would be run automatically