inlm/schema-generator

v0.5.2 2017-11-25 11:11 UTC

README

Build Status

Become a Patron!

Installation

Download a latest package or use Composer:

composer require inlm/schema-generator

Schema Generator requires PHP 5.6.0 or later.

Usage

$extractor = new Inlm\SchemaGenerator\Extractors\LeanMapperExtractor(__DIR__ . '/model/Entities/', new LeanMapper\DefaultMapper);
$adapter = new Inlm\SchemaGenerator\Adapters\NeonAdapter(__DIR__ . '/.schema.neon');
$dumper = new Inlm\SchemaGenerator\Dumpers\SqlDumper(__DIR__ . '/migrations/structures/');
$logger = new Inlm\SchemaGenerator\Loggers\MemoryLogger;

$generator = new Inlm\SchemaGenerator\SchemaGenerator($extractor, $adapter, $dumper, $logger, Inlm\SchemaGenerator\SchemaGenerator::MYSQL);
// $generator->setTestMode();

$generator->generate();
// or
$generator->generate('changes description');

Documentation

Supported databases:

  • MySQL

Extractors

Extracts new database schema from given source - entities, database or file.

Adapters

Persists database schema in file, memory,...

Dumpers

Dumps changes of database schema into migration file, database,...

Loggers

License: New BSD License
Author: Jan Pecha, https://www.janpecha.cz/