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

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

cycle/migrations
================

Database migrations, migration scaffolding

v4.2.6(10mo ago)20539.5k↑10.6%18[3 PRs](https://github.com/cycle/migrations/pulls)20MITPHPPHP &gt;=8.1CI passing

Since Mar 29Pushed 10mo ago3 watchersCompare

[ Source](https://github.com/cycle/migrations)[ Packagist](https://packagist.org/packages/cycle/migrations)[ RSS](/packages/cycle-migrations/feed)WikiDiscussions 4.x Synced 1mo ago

READMEChangelog (10)Dependencies (10)Versions (33)Used By (20)

Cycle Database Migrations
=========================

[](#cycle-database-migrations)

[![Latest Stable Version](https://camo.githubusercontent.com/c811eadf2dd2b7cfd0f218f6e6f1d85409dfd0e27d2d72fe2fb1dab1f8724e8f/68747470733a2f2f706f7365722e707567782e6f72672f6379636c652f6d6967726174696f6e732f762f737461626c65)](https://packagist.org/packages/cycle/migrations)[![Build Status](https://github.com/cycle/migrations/workflows/build/badge.svg)](https://github.com/cycle/migrations/actions)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/6cdc834558def61a3239580610e9e08ba4443e1747803acad3133853d550b478/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6379636c652f6d6967726174696f6e732f6261646765732f7175616c6974792d73636f72652e706e673f623d342e78)](https://scrutinizer-ci.com/g/cycle/migrations/?branch=4.x)[![Codecov](https://camo.githubusercontent.com/7bfa24934a3202334187f013aed7a32c9c921a1dcb03d55f189e3190b2d25722/68747470733a2f2f636f6465636f762e696f2f67682f6379636c652f6d6967726174696f6e732f6272616e63682f342e782f67726170682f62616467652e737667)](https://codecov.io/gh/cycle/migrations/)

Migrations are a convenient way for you to alter your database in a structured and organized manner. This package adds additional functionality for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

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

[](#installation)

```
composer require cycle/migrations ^4.0
```

Configuration
-------------

[](#configuration)

```
use Cycle\Migrations;
use Cycle\Database;
use Cycle\Database\Config;

$dbal = new Database\DatabaseManager(new Config\DatabaseConfig([
    'default' => 'default',
    'databases' => [
        'default' => [
            'connection' => 'sqlite'
        ]
    ],
    'connections' => [
        'sqlite' => new Config\SQLiteDriverConfig(
            connection: new Config\SQLite\MemoryConnectionConfig(),
            queryCache: true,
        ),
    ]
]));

$config = new Migrations\Config\MigrationConfig([
    'directory' => __DIR__ . '/../migrations/',    // where to store migrations
    'vendorDirectories' => [                       // Where to look for vendor package migrations
        __DIR__ . '/../vendor/vendorName/packageName/migrations/'
    ],
    'table' => 'migrations'                       // database table to store migration status
    'safe' => true                                // When set to true no confirmation will be requested on migration run.
]);

$migrator = new Migrations\Migrator(
    $config,
    $dbal,
    new Migrations\FileRepository($config)
);

// Init migration table
$migrator->configure();
```

Running
-------

[](#running)

```
while (($migration = $migrator->run()) !== null) {
    echo 'Migrate ' . $migration->getState()->getName();
}
```

Generate Migrations
-------------------

[](#generate-migrations)

You can automatically generate a set of migration files during schema compilation. In this case, you have the freedom to alter such migrations manually before running them. To achieve that you must install the [Schema migrations generator extension](https://github.com/cycle/schema-migrations-generator).

License:
--------

[](#license)

MIT License (MIT). Please see [`LICENSE`](./LICENSE) for more information. Maintained by [Spiral Scout](https://spiralscout.com).

###  Health Score

57

—

FairBetter than 98% of packages

Maintenance54

Moderate activity, may be stable

Popularity49

Moderate usage in the ecosystem

Community36

Small or concentrated contributor base

Maturity79

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~79 days

Recently: every ~133 days

Total

30

Last Release

310d ago

Major Versions

v1.0.10 → v2.0.02021-11-12

1.x-dev → v3.0.02021-12-22

v3.1.0 → v4.0.02022-10-14

v3.1.1 → v4.1.02023-05-16

3.x-dev → v4.2.12023-11-21

PHP version history (5 changes)v1.0.0PHP ^7.1|^8.0

v1.0.4PHP ^7.2

v1.0.9PHP &gt;=7.2

v3.0.0PHP &gt;=8.0

v4.0.0PHP &gt;=8.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/796136?v=4)[Anton Tsitou](/maintainers/wolfy-j)[@wolfy-j](https://github.com/wolfy-j)

---

Top Contributors

[![wolfy-j](https://avatars.githubusercontent.com/u/796136?v=4)](https://github.com/wolfy-j "wolfy-j (74 commits)")[![roxblnfk](https://avatars.githubusercontent.com/u/4152481?v=4)](https://github.com/roxblnfk "roxblnfk (37 commits)")[![msmakouz](https://avatars.githubusercontent.com/u/67324318?v=4)](https://github.com/msmakouz "msmakouz (12 commits)")[![EvgenyBarinov](https://avatars.githubusercontent.com/u/65846823?v=4)](https://github.com/EvgenyBarinov "EvgenyBarinov (5 commits)")[![butschster](https://avatars.githubusercontent.com/u/773481?v=4)](https://github.com/butschster "butschster (4 commits)")[![puzzledpolymath](https://avatars.githubusercontent.com/u/162779269?v=4)](https://github.com/puzzledpolymath "puzzledpolymath (3 commits)")[![alexndr-novikov](https://avatars.githubusercontent.com/u/7372962?v=4)](https://github.com/alexndr-novikov "alexndr-novikov (2 commits)")[![AnrDaemon](https://avatars.githubusercontent.com/u/6532485?v=4)](https://github.com/AnrDaemon "AnrDaemon (2 commits)")[![bautrukevich](https://avatars.githubusercontent.com/u/1747220?v=4)](https://github.com/bautrukevich "bautrukevich (2 commits)")[![SerafimArts](https://avatars.githubusercontent.com/u/2461257?v=4)](https://github.com/SerafimArts "SerafimArts (2 commits)")[![vvval](https://avatars.githubusercontent.com/u/11367763?v=4)](https://github.com/vvval "vvval (2 commits)")[![aywan](https://avatars.githubusercontent.com/u/5608711?v=4)](https://github.com/aywan "aywan (1 commits)")[![arogachev](https://avatars.githubusercontent.com/u/8326201?v=4)](https://github.com/arogachev "arogachev (1 commits)")[![rauanmayemir](https://avatars.githubusercontent.com/u/9691?v=4)](https://github.com/rauanmayemir "rauanmayemir (1 commits)")[![aquaminer](https://avatars.githubusercontent.com/u/17113289?v=4)](https://github.com/aquaminer "aquaminer (1 commits)")[![Anry7794](https://avatars.githubusercontent.com/u/100683495?v=4)](https://github.com/Anry7794 "Anry7794 (1 commits)")[![vokomarov](https://avatars.githubusercontent.com/u/8015167?v=4)](https://github.com/vokomarov "vokomarov (1 commits)")[![js361014](https://avatars.githubusercontent.com/u/37348338?v=4)](https://github.com/js361014 "js361014 (1 commits)")[![leon0399](https://avatars.githubusercontent.com/u/1759654?v=4)](https://github.com/leon0399 "leon0399 (1 commits)")

---

Tags

cyclehacktoberfestmigrationsormphp

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[cycle/orm

PHP DataMapper ORM and Data Modelling Engine

1.3k835.4k65](/packages/cycle-orm)[cycle/database

DBAL, schema introspection, migration and pagination

64690.9k31](/packages/cycle-database)[cycle/annotated

Cycle ORM Annotated Entities generator

28724.2k44](/packages/cycle-annotated)[spiral/cycle-bridge

Cycle ORM integration package

18128.9k7](/packages/spiral-cycle-bridge)[wayofdev/laravel-cycle-orm-adapter

🔥 A Laravel adapter for CycleORM, providing seamless integration of the Cycle DataMapper ORM for advanced database handling and object mapping in PHP applications.

3516.7k3](/packages/wayofdev-laravel-cycle-orm-adapter)[spiral/grpc-client

gRPC client

41140.3k2](/packages/spiral-grpc-client)

PHPackages © 2026

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