PHPackages                             hipay/php-database-migration - 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. hipay/php-database-migration

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

hipay/php-database-migration
============================

rake and mybatis SQL migration tool

v4.1.0(10y ago)07.1kMITPHPPHP &gt;=5.4.0

Since Jun 21Pushed 10y ago1 watchersCompare

[ Source](https://github.com/hipay/php-database-migration)[ Packagist](https://packagist.org/packages/hipay/php-database-migration)[ Docs](https://github.com/hipay/php-database-migration)[ RSS](/packages/hipay-php-database-migration/feed)WikiDiscussions stable Synced 4w ago

READMEChangelogDependencies (6)Versions (18)Used By (0)

PhpDbMigration - full PHP database migration tool
=================================================

[](#phpdbmigration---full-php-database-migration-tool)

This is a full standalone PHP tool based on symfony console and inspired by the rails database migration tool and MyBatis. It merge the functionnality of the two tools and has been desined to be as flexible as possible.

Installing it to your project
-----------------------------

[](#installing-it-to-your-project)

Just add it to your composer.json (don't forget to specify your bin directory) Warning, all migrate commands must be executed on your root folder like `bin/migrate migrate:command...`

```
{
    "name": "jdoe/testproject",
    "authors": [
        {
            "name": "Jhon DOE",
            "email": "jdoe@gmail.com"
        }
    ],
    "require": {
        "php-database-migration/php-database-migration" :"3.4.*"
    },
    "config": {
        "bin-dir": "bin"
    }
}

```

Adding an environment
---------------------

[](#adding-an-environment)

The first thing to do before playing with SQL migrations is to add an environment, let's add the dev one.

[![alt tag](https://camo.githubusercontent.com/169dff9f89f91bb78204b6d18c9681faa04a2a6ae1b2b9852dcfd6b03342c389/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f616464656e762e676966)](https://camo.githubusercontent.com/169dff9f89f91bb78204b6d18c9681faa04a2a6ae1b2b9852dcfd6b03342c389/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f616464656e762e676966)

Initialization
--------------

[](#initialization)

Once the environment is added, you have to initialize it (create the changelog table on the good database)

[![alt tag](https://camo.githubusercontent.com/d34bd7e4ba8d895fb20969051f0bdff954e42923dfa27f73096bc77bc41e858b/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f696e69742e676966)](https://camo.githubusercontent.com/d34bd7e4ba8d895fb20969051f0bdff954e42923dfa27f73096bc77bc41e858b/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f696e69742e676966)

Create a migration
------------------

[](#create-a-migration)

It is time to create our first migration file.

[![alt tag](https://camo.githubusercontent.com/a960b088cf5a1d005d204c17569014608973d334cc06b2254896f450f422e06e/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f6372656174652e676966)](https://camo.githubusercontent.com/a960b088cf5a1d005d204c17569014608973d334cc06b2254896f450f422e06e/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f6372656174652e676966)

Migrations file are like this

```
--// add table users
-- Migration SQL that makes the change goes here.
create table users (id integer, name text);
-- @UNDO
-- SQL to undo the change goes here.
drop table users;

```

Up and down
-----------

[](#up-and-down)

You can now up all the pending migrations. If you decided to down a migration, the last one will be downed alone to prevent from mistake. You will be asked to confirm the downgrade of your database before runing the real SQL script. [![alt tag](https://camo.githubusercontent.com/9d90a66c277b104850881c73b95ece78330afef1f1247fa0170e4a6d74f74560/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f7374617475732e676966)](https://camo.githubusercontent.com/9d90a66c277b104850881c73b95ece78330afef1f1247fa0170e4a6d74f74560/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f7374617475732e676966)

For developement purpose, it is also possible to up a single migration without taking care of the other ones.

[![alt tag](https://camo.githubusercontent.com/288ff1734d9b0bc904a7d1f8f188549126c48cc8c9065344f6053b5bf215d64f/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f75706f6e6c792e676966)](https://camo.githubusercontent.com/288ff1734d9b0bc904a7d1f8f188549126c48cc8c9065344f6053b5bf215d64f/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f75706f6e6c792e676966)

Same thing for down

[![alt tag](https://camo.githubusercontent.com/492ead96a60ae7fa1894b65e96440943f70298ed46b7feec090f442ee6a03b62/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f646f776e6f6e6c792e676966)](https://camo.githubusercontent.com/492ead96a60ae7fa1894b65e96440943f70298ed46b7feec090f442ee6a03b62/687474703a2f2f74696b6f746570616476656e747572652e636f6d2f66696c65732f7068702d64617461626173652d6d6967726174696f6e2f646f776e6f6e6c792e676966)

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity67

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

Recently: every ~88 days

Total

17

Last Release

3778d ago

Major Versions

1.0.0 → 2.0.02014-02-04

2.2.1 → v3.0.02015-02-27

v3.4.4 → v4.0.02016-02-26

PHP version history (2 changes)1.0.0PHP &gt;=5.3.0

v4.1.0PHP &gt;=5.4.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12674072?v=4)[HiPay](/maintainers/hipay)[@hipay](https://github.com/hipay)

---

Top Contributors

[![alwex](https://avatars.githubusercontent.com/u/63174?v=4)](https://github.com/alwex "alwex (22 commits)")[![br39](https://avatars.githubusercontent.com/u/25536771?v=4)](https://github.com/br39 "br39 (15 commits)")[![jcorre-hipay](https://avatars.githubusercontent.com/u/17492052?v=4)](https://github.com/jcorre-hipay "jcorre-hipay (14 commits)")

---

Tags

migrationsqlrakemybatis

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/hipay-php-database-migration/health.svg)

```
[![Health](https://phpackages.com/badges/hipay-php-database-migration/health.svg)](https://phpackages.com/packages/hipay-php-database-migration)
```

###  Alternatives

[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M559](/packages/shopware-core)[shopware/platform

The Shopware e-commerce core

3.4k1.5M3](/packages/shopware-platform)[kimai/kimai

Kimai - Time Tracking

4.8k9.0k1](/packages/kimai-kimai)[open-dxp/opendxp

Content &amp; Product Management Framework (CMS/PIM)

9421.6k60](/packages/open-dxp-opendxp)[perplorm/perpl

Perpl is an improved and still maintained fork of Propel2, an open-source Object-Relational Mapping (ORM) for PHP.

2411.8k](/packages/perplorm-perpl)

PHPackages © 2026

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