PHPackages                             eliasfarah/db-struct-sync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. eliasfarah/db-struct-sync

ActiveLibrary[Database &amp; ORM](/categories/database)

eliasfarah/db-struct-sync
=========================

mysql structure syncronisation tool

v1.0.0(7y ago)018PHPPHP &gt;=5.3.0

Since Sep 25Pushed 7y ago2 watchersCompare

[ Source](https://github.com/eliasfarah/dbStructSync)[ Packagist](https://packagist.org/packages/eliasfarah/db-struct-sync)[ Docs](https://github.com/gerkirill/dbStructSync)[ RSS](/packages/eliasfarah-db-struct-sync/feed)WikiDiscussions master Synced yesterday

READMEChangelog (1)DependenciesVersions (3)Used By (0)

```
Original Owner of this project is https://github.com/gerkirill/dbStructSync

The class provides ability to compare 2 database structure dumps and compile a set of sql statements to update
one database to make it structure identical to another.

The input for the script could be taken from the phpMyAdmin structure dump, or provided by some custom code
that uses 'SHOW CREATE TABLE' query to get database structure table by table.
The output is either array of sql statements suitable for executions right from php or a string where the
statements are placed each at new line and delimited with ';' - suitable for execution from phpMyAdmin SQL
page.
The resulting sql may contain queries that aim to:
Create missing table (CREATE TABLE query)
Delete table which should not longer exist (DROP TABLE query)
Update, drop or add table field or index definition (ALTER TABLE query)

Some features:
- AUTO_INCREMENT value is ommited during the comparison and in resulting CREATE TABLE sql
- fields with definitions like "(var)char (255) NOT NULL default ''" and "(var)char (255) NOT NULL" are treated
  as equal, the same for (big|tiny)int NOT NULL default 0;
- IF NOT EXISTS is automatically added to the resulting sql CREATE TABLE statement
- fields updating queries always come before key modification ones for each table
Not implemented:
- The class even does not try to insert or re-order fields in the same order as in the original table.
  Does order matter?
IMPORTANT!!! Class will not handle a case when the field was renamed. It will generate 2 queries - one to drop
the column with the old name and one to create column with the new name, so if there is a data in the dropped
column, it will be lost.
Usage example:
$updater = new dbStructUpdater();
$res = $updater->getUpdates($struct1, $struct2);
-----
$res == array (
	[0]=>"ALTER TABLE `b` MODIFY `name` varchar(255) NOT NULL",
	...
)
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

2787d ago

Major Versions

0.0.1 → v1.0.02018-09-25

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/613459?v=4)[Ger Kirill](/maintainers/gerkirill)[@gerkirill](https://github.com/gerkirill)

![](https://avatars.githubusercontent.com/u/234085?v=4)[Elias Farah](/maintainers/eliasfarah)[@eliasfarah](https://github.com/eliasfarah)

---

Top Contributors

[![eliasfarah](https://avatars.githubusercontent.com/u/234085?v=4)](https://github.com/eliasfarah "eliasfarah (4 commits)")[![gerkirill](https://avatars.githubusercontent.com/u/613459?v=4)](https://github.com/gerkirill "gerkirill (2 commits)")

---

Tags

mysqlsyncstructure sync

### Embed Badge

![Health badge](/badges/eliasfarah-db-struct-sync/health.svg)

```
[![Health](https://phpackages.com/badges/eliasfarah-db-struct-sync/health.svg)](https://phpackages.com/packages/eliasfarah-db-struct-sync)
```

###  Alternatives

[doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database schema introspection and management.

9.7k578.4M5.6k](/packages/doctrine-dbal)[kirschbaum-development/eloquent-power-joins

The Laravel magic applied to joins.

1.6k25.2M34](/packages/kirschbaum-development-eloquent-power-joins)[scienta/doctrine-json-functions

A set of extensions to Doctrine that add support for json query functions.

58523.9M36](/packages/scienta-doctrine-json-functions)[awssat/laravel-sync-migration

Laravel tool helps to sync migrations without refreshing the database

10923.2k](/packages/awssat-laravel-sync-migration)[cytopia/mysqldump-secure

Secure mysqldump script with encryption, compression, logging, blacklisting and Nagios monitoring integration

1474.7k1](/packages/cytopia-mysqldump-secure)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
