2017 © Pedro Peláez
 

library schemadiff

Schema Diff: Show difference between MySQL databases

image

phlib/schemadiff

Schema Diff: Show difference between MySQL databases

  • Tuesday, May 9, 2017
  • by letssurf
  • Repository
  • 4 Watchers
  • 2 Stars
  • 307 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 12 % Grown

The README.md

phlib/schemadiff

Code Checks Codecov Latest Stable Version Total Downloads Licence, (*1)

MySQL Schema Diff, a Symfony Console tool for displaying differeance between two schemas. This can be useful by showing differences between production and development. It's then up to the developer to create some kind of migration scripts., (*2)

Install

Via Composer, (*3)

Single project ``` bash $ composer require phlib/schemadiff, (*4)


Globally ``` bash $ composer global require phlib/schemadiff

Command Line Usage

If you install schemadiff globally, (*5)

And add this to your PATH in your ~/.bash_profile ``` bash export PATH=~/.composer/vendor/bin:$PATH, (*6)


Then you can run schemadiff like this ``` bash $ schemadiff --help $ schemadiff h=127.0.0.1,u=user,p=pass,D=db1 h=127.0.0.1,u=user,p=pass,D=db2

Otherwise run it from your project ``` bash $ ./vendor/bin/schemadiff --help $ ./vendor/bin/schemadiff h=127.0.0.1,u=user,p=pass,D=db1 h=127.0.0.1,u=user,p=pass,D=db2, (*7)


## PHP Usage ``` php <?php $pdo = new \PDO('mysql:...', $username, $password); $schemaInfo1 = \Phlib\SchemaDiff\SchemaInfoFactory::fromPdo($pdo, 'db1'); $schemaInfo2 = \Phlib\SchemaDiff\SchemaInfoFactory::fromPdo($pdo, 'db2'); $schemaDiff = new \Phlib\SchemaDiff\SchemaDiff( new Symfony\Component\Console\Output\StreamOutput(STDOUT) ); $different = $schemaDiff->diff($schemaInfo1, $schemaInfo2); exit($different ? 1 : 0);

Example Ouput

Output shows difference between the schemas. Example 1, (*8)

As the database names could be the same on different hosts, the DSN position is included. Example 2, (*9)

Testing different copies match a tempalte database. Example 3, (*10)

License

This package is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version., (*11)

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details., (*12)

You should have received a copy of the GNU Lesser General Public License along with this program. If not, see http://www.gnu.org/licenses/., (*13)

The Versions

09/05 2017

dev-master

9999999-dev https://github.com/phlib/schemadiff

Schema Diff: Show difference between MySQL databases

  Sources   Download

LGPL-3.0

The Requires

 

by James Dempster

schema mysql diff

02/02 2017

1.0.1

1.0.1.0 https://github.com/phlib/schemadiff

Schema Diff: Show difference between MySQL databases

  Sources   Download

LGPL-3.0

The Requires

 

by James Dempster

schema mysql diff

02/02 2017

1.0.0

1.0.0.0 https://github.com/phlib/schemadiff

Schema Diff: Show difference between MySQL databases

  Sources   Download

LGPL-3.0

The Requires

 

by James Dempster

schema mysql diff