Statistics
34
0
0
5d
Badges

Schema Generator

Build Status

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/

  • v0.5.2 Version 0.5.2

    • SchemaGenerator - added method removeOption()
    • improved handling of datatypes
    • updated README & docs
  • v0.5.1 Version 0.5.1

    • added parameter $description to $generator->generate()
  • v0.5.0 Version 0.5.0

    • added NeonExtractor
    • added MemoryAdapter
    • fixed Utils\Generator
    • DibiDumper - fixed $dibi->query()
    • LeanMapperExtractor - fixed DateTime recognition
    • Utils\Generator - improved column updating
    • uses czproject/logger
  • v0.4.0 Version 0.4.0

    • SqlDumper: throws exception if file already exists
    • SqlDumper: setDeepStructure replaced by setOutputStructure
  • v0.3.1 Version 0.3.1

    • DataTypeParser - added support for strings & enum
    • Readme: updated
  • v0.3.0 Version 0.3.0

    First public release.

Is this addon outdated? Did you find an issue? Please report it.

Componette Componette admin@componette.com