PHPackages                             brain-diminished/schema-version-control - 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. brain-diminished/schema-version-control

ActiveLibrary

brain-diminished/schema-version-control
=======================================

1.0.5(5y ago)359.4k↓36.7%3[2 PRs](https://github.com/brain-diminished/schema-version-control/pulls)1MITPHPCI failing

Since Feb 19Pushed 2y ago2 watchersCompare

[ Source](https://github.com/brain-diminished/schema-version-control)[ Packagist](https://packagist.org/packages/brain-diminished/schema-version-control)[ RSS](/packages/brain-diminished-schema-version-control/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (5)Versions (8)Used By (1)

Schema Version Control
======================

[](#schema-version-control)

This package provides a set of tools useful for managing your database schemas, more precisely when it comes to sharing your model within a versioned project. In order to do so, the model will actually be tracked as a YAML file.

Service
-------

[](#service)

The main class of this project is `SchemaVersionControlService`; this service provides operations involving `Doctrine\DBAL\Schema\Schema` objects. The constructor of `SchemaVersionControlService` needs two parameters: a `Connection` object to be able to inspect current database schema (please note that this connection should be allowed to create/update/delete tables), as well as the path to your schema file (which might not exist yet when initializing the project). The two principal methods of this class are:

- `applySchema()`: this method loads the schema described in your schema file (supposedly versioned), compares it with the actual schema in database, and executes the SQL statements necessary to solve the differences. You should use this method when updating your source code, assuming that you haven't changed your model locally (if so, you may want to refer to [Resolve Conflicts](#resolve_conflicts) section).
- `dumpSchema()`: this method, opposed to `applySchema()`, inspects the current schema used in database, and uses it to change the content of your schema file. You should use this method when modifying your model locally, assuming that your model was up-to-date before you started the modifications (otherwise, once again, refer to [Resolve Conflicts](#resolve_conflicts) section).

In addition, you will find a few other methods, such as `getMigrationSql()` to compute the SQL statements to execute in order to resynchronize your database schema with your schema file, or `getSchemaDiff()` to compute the `SchemaDiff`object representing the difference between the actual database schema and the one described in the schema file.

Resolve conflicts
-----------------

[](#resolve-conflicts)

It is advised that you update and commit your schema before updating your sources. Therefore, you will simply have to resolve the conflicts (if any) in the YAML file, which should not be too complicated.

If you did not commit before pulling sources, applying the schema from YAML file will most certainly end up removing your modification, which you probably do not want. First dump your schema, review the modifications in YAML file (recently pulled changes will have been reverted), and only keep those that were actually your doing. You should then be safe for applying the newly obtained version of your schema.

Commands
--------

[](#commands)

In order to be used through Symfony console, this package provides these three commands:

- `schema:dump` (cf. `SchemaVersionControlService::dump()`).
- `schema:apply` (cf. `SchemaVersionControlService::apply()`): Note that option `--dry-run` may be useful, particularly when you need to update the schema of an application running in production.
- `schema:status`: Displays all changes performed on actual schema, relatively to YAML schema file. Therefore, all differences between the two schemas are considered as local changes, even when they actually result from pulled changes on YAML file.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity34

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 70.4% 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 ~142 days

Recently: every ~82 days

Total

6

Last Release

2116d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/10856512?v=4)[Dorian Savina](/maintainers/brain-diminished)[@brain-diminished](https://github.com/brain-diminished)

---

Top Contributors

[![brain-diminished](https://avatars.githubusercontent.com/u/10856512?v=4)](https://github.com/brain-diminished "brain-diminished (19 commits)")[![Kharhamel](https://avatars.githubusercontent.com/u/10496706?v=4)](https://github.com/Kharhamel "Kharhamel (6 commits)")[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/brain-diminished-schema-version-control/health.svg)

```
[![Health](https://phpackages.com/badges/brain-diminished-schema-version-control/health.svg)](https://phpackages.com/packages/brain-diminished-schema-version-control)
```

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M651](/packages/sylius-sylius)[shopware/platform

The Shopware e-commerce core

3.3k1.5M3](/packages/shopware-platform)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[october/rain

October Rain Library

1601.7M63](/packages/october-rain)[contao/core-bundle

Contao Open Source CMS

1231.6M2.4k](/packages/contao-core-bundle)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

595.2M386](/packages/shopware-core)

PHPackages © 2026

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