PHPackages                             formal/migrations - 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. formal/migrations

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

formal/migrations
=================

SQL and Commands migrations

2.0.0(2mo ago)0495↓70%MITPHPPHP ~8.4CI passing

Since Oct 4Pushed 2mo ago1 watchersCompare

[ Source](https://github.com/formal-php/migrations)[ Packagist](https://packagist.org/packages/formal/migrations)[ Docs](http://github.com/formal-php/migrations)[ RSS](/packages/formal-migrations/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (3)Dependencies (10)Versions (5)Used By (0)

migrations
==========

[](#migrations)

[![CI](https://github.com/formal-php/migrations/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/formal-php/migrations/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/d02a47353a6bd25c35061ea02d45ee9a97999ce1d6829219ecd558597d7a423c/68747470733a2f2f636f6465636f762e696f2f67682f666f726d616c2d7068702f6d6967726174696f6e732f6272616e63682f646576656c6f702f67726170682f62616467652e737667)](https://codecov.io/gh/formal-php/migrations)[![Type Coverage](https://camo.githubusercontent.com/c121b2682fcbd6db928363ddb19d092bca02c7fc99e12f2e47145d11c0e6434c/68747470733a2f2f73686570686572642e6465762f6769746875622f666f726d616c2d7068702f6d6967726174696f6e732f636f7665726167652e737667)](https://shepherd.dev/github/formal-php/migrations)

This library is a simple one way migration system.

You can run both SQL and Commands migrations.

Installation
------------

[](#installation)

```
composer require formal/migrations
```

Usage
-----

[](#usage)

```
use Formal\Migrations\{
    Factory,
    Failure,
}
use Innmind\OperatingSystem\Factory as OS;
use Innmind\Url\{
    Url,
    Path,
};

$dsn = Url::of('mysql://user:pwd@127.0.0.1:3306/database');

Factory::of(OS::build())
    ->storeVersionsInDatabase($dsn)
    ->unwrap()
    ->sql()
    ->files(Path::of('migrations/folder/'))
    ->migrate($dsn)
    ->match(
        static fn() => print('Everything has been migrated'),
        static fn(Failure $failure) => printf(
            'Migrations failed with the message : %s',
            $failure->error()->getMessage(),
        ),
    );
```

Documentation
-------------

[](#documentation)

Full documentation available [here](https://formal-php.github.io/migrations/).

###  Health Score

45

—

FairBetter than 91% of packages

Maintenance85

Actively maintained with recent releases

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~273 days

Total

3

Last Release

80d ago

Major Versions

1.1.0 → 2.0.02026-04-04

PHP version history (2 changes)1.0.0PHP ~8.2

2.0.0PHP ~8.4

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/851425?v=4)[Baptiste Langlade](/maintainers/Baptouuuu)[@Baptouuuu](https://github.com/Baptouuuu)

---

Top Contributors

[![Baptouuuu](https://avatars.githubusercontent.com/u/851425?v=4)](https://github.com/Baptouuuu "Baptouuuu (67 commits)")

---

Tags

clidatabasesqlmigrationscommands

###  Code Quality

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/formal-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/formal-migrations/health.svg)](https://phpackages.com/packages/formal-migrations)
```

###  Alternatives

[rah/danpu

Zero-dependency MySQL dump library for easily exporting and importing databases

62410.3k11](/packages/rah-danpu)[davmixcool/php-dbcloud

Easily backup PostgreSql or MySql database to the cloud

111.5k](/packages/davmixcool-php-dbcloud)

PHPackages © 2026

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