sonrac/symfony-seed-command

Symfony simple seed command

1.7.3 2020-06-03 11:39 UTC

This package is auto-updated.

Last update: 2024-03-29 03:50:45 UTC


README

Build Status StyleCI

Scrutinizer Build Scrutinizer Scrutinizer Code Coverage codecov Packagist Latest Unstable Version License Total Downloads Monthly Downloads Daily Downloads composer.lock

Install

composer require sonrac/symfony-seed-command

Introduction

The package is designed to fill the database with data bypassing migrations.

Usages for silex or symfony

Add to console application command sonrac\SeedCommand, as example, for silex:

$app->add(new sonrac\SimpleSeed\SeedCommand(null, $app->get('db')));

Create seed:

Seed class must be implement sonrac\SimpleSeed\SeedInterface

Predefined seed classes

  • 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