{"id":44882495,"url":"https://github.com/phlib/schemadiff","last_synced_at":"2026-02-17T16:30:50.017Z","repository":{"id":16839827,"uuid":"80732101","full_name":"phlib/schemadiff","owner":"phlib","description":"PHP MySQL Schema Diff","archived":false,"fork":false,"pushed_at":"2025-02-10T16:45:09.000Z","size":323,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-25T22:02:56.020Z","etag":null,"topics":["console","diff","php","schema"],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/phlib.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2017-02-02T14:21:51.000Z","updated_at":"2025-02-16T13:06:55.000Z","dependencies_parsed_at":"2024-02-02T17:28:00.116Z","dependency_job_id":"b6190e16-c187-408c-bdff-97c478fb7f86","html_url":"https://github.com/phlib/schemadiff","commit_stats":{"total_commits":41,"total_committers":3,"mean_commits":"13.666666666666666","dds":"0.31707317073170727","last_synced_commit":"cb78b59d29f075f29bc4b2840f294d4d5b4e6701"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/phlib/schemadiff","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlib%2Fschemadiff","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlib%2Fschemadiff/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlib%2Fschemadiff/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlib%2Fschemadiff/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/phlib","download_url":"https://codeload.github.com/phlib/schemadiff/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/phlib%2Fschemadiff/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29549795,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-17T14:33:00.708Z","status":"ssl_error","status_checked_at":"2026-02-17T14:32:58.657Z","response_time":100,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["console","diff","php","schema"],"created_at":"2026-02-17T16:30:49.429Z","updated_at":"2026-02-17T16:30:50.012Z","avatar_url":"https://github.com/phlib.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phlib/schemadiff\n\n[![Code Checks](https://img.shields.io/github/actions/workflow/status/phlib/schemadiff/code-checks.yml?logo=github)](https://github.com/phlib/schemadiff/actions/workflows/code-checks.yml)\n[![Codecov](https://img.shields.io/codecov/c/github/phlib/schemadiff.svg?logo=codecov)](https://codecov.io/gh/phlib/schemadiff)\n[![Latest Stable Version](https://img.shields.io/packagist/v/phlib/schemadiff.svg?logo=packagist)](https://packagist.org/packages/phlib/schemadiff)\n[![Total Downloads](https://img.shields.io/packagist/dt/phlib/schemadiff.svg?logo=packagist)](https://packagist.org/packages/phlib/schemadiff)\n![Licence](https://img.shields.io/github/license/phlib/schemadiff.svg)\n\nMySQL 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.\n\n## Install\n\nVia Composer\n\nSingle project\n``` bash\n$ composer require phlib/schemadiff\n```\n\nGlobally\n``` bash\n$ composer global require phlib/schemadiff\n```\n\n## Command Line Usage\n\nIf you install schemadiff globally\n\nAnd add this to your PATH in your ~/.bash_profile\n``` bash\nexport PATH=~/.composer/vendor/bin:$PATH\n```\n\nThen you can run schemadiff like this\n``` bash \n$ schemadiff --help\n$ schemadiff h=127.0.0.1,u=user,p=pass,D=db1 h=127.0.0.1,u=user,p=pass,D=db2\n```\n\nOtherwise run it from your project\n``` bash\n$ ./vendor/bin/schemadiff --help\n$ ./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\n```\n\n## PHP Usage\n``` php\n\u003c?php\n\n$pdo = new \\PDO('mysql:...', $username, $password);\n$schemaInfo1 = \\Phlib\\SchemaDiff\\SchemaInfoFactory::fromPdo($pdo, 'db1');\n$schemaInfo2 = \\Phlib\\SchemaDiff\\SchemaInfoFactory::fromPdo($pdo, 'db2');\n\n$schemaDiff = new \\Phlib\\SchemaDiff\\SchemaDiff(\n    new Symfony\\Component\\Console\\Output\\StreamOutput(STDOUT)\n);\n$different = $schemaDiff-\u003ediff($schemaInfo1, $schemaInfo2);\n\nexit($different ? 1 : 0);\n\n```\n\n## Example Ouput\n\nOutput shows difference between the schemas.\n![Example 1](examples/example-01.png)\n\nAs the database names could be the same on different hosts, the DSN position is included.\n![Example 2](examples/example-02.png)\n\nTesting different copies match a tempalte database.\n![Example 3](examples/example-03.png)\n\n## License\n\nThis package is free software: you can redistribute it and/or modify\nit under the terms of the GNU Lesser General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU Lesser General Public License for more details.\n\nYou should have received a copy of the GNU Lesser General Public License\nalong with this program.  If not, see \u003chttp://www.gnu.org/licenses/\u003e.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlib%2Fschemadiff","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fphlib%2Fschemadiff","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fphlib%2Fschemadiff/lists"}