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

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

vakata/migrations
=================

PHP database migrations

1.1.2(1y ago)02.2k↓77.8%MITPHPPHP &gt;=8.0

Since Dec 5Pushed 1y ago1 watchersCompare

[ Source](https://github.com/vakata/migrations)[ Packagist](https://packagist.org/packages/vakata/migrations)[ Docs](https://github.com/vakata/migrations)[ RSS](/packages/vakata-migrations/feed)WikiDiscussions main Synced yesterday

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

migrations
==========

[](#migrations)

[![Latest Version on Packagist](https://camo.githubusercontent.com/3ff4ed28f5b0bbd1a14d9bff1969967c4566337d576e25a4757265ed63b4f2b5/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76616b6174612f6d6967726174696f6e732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/vakata/migrations)[![Software License](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE.md)

PHP database migrations.

Install
-------

[](#install)

Via Composer

```
$ composer require vakata/migrations
```

Usage
-----

[](#usage)

Prepare a directory for all migrations. A migration consists of a folder with 3 files inside:

- schema.sql - needed schema modifications
- data.sql - optional data to insert / update / delete
- uninstall.sql - optional statements to fully revert this migration

Example structure:

```
 |-migrations
   |- base
   |  |- _core
   |     |- 000
   |        |- schema.sql
   |        |- data.sql
   |        |- uninstall.sql
   |- app
      |- feature1
      |  |- 000
      |  |  |- schema.sql
      |  |  |- data.sql
      |  |  |- uninstall.sql
      |  |- 001
      |     |- schema.sql
      |- feature2
         |- 000
            |- schema.sql
            |- uninstall.sql

```

Create the neccessary table, for example:

```
-- postgre
CREATE TABLE IF NOT EXISTS migrations (
  migration SERIAL NOT NULL,
  package varchar(255) NOT NULL,
  installed timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
  removed timestamp DEFAULT NULL ,
  PRIMARY KEY (migration)
);
-- mysql
CREATE TABLE IF NOT EXISTS migrations (
  migration bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  package varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  installed datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  removed datetime DEFAULT NULL,
  PRIMARY KEY (migration)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ;
```

```
$migrations = new \vakata\migrations\Migrations(
    new \vakata\database\DB(''),
    'path/to/migrations/folder',
    [ 'base/', 'app/feature2', 'app' ] // optional feature flags (also used for sorting)
    null // optional sort callback
);
// this will install the packages in this order:
// base/_core/000, app/feature2/000, app/feature1/000, app/feature1/000
$migrations->up();
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

Security
--------

[](#security)

If you discover any security related issues, please email  instead of using the issue tracker.

Credits
-------

[](#credits)

- [vakata](https://github.com/vakata)
- [All Contributors](../../contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](LICENSE) for more information.

###  Health Score

32

—

LowBetter than 69% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

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

Total

5

Last Release

516d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/146052?v=4)[Ivan Bozhanov](/maintainers/vakata)[@vakata](https://github.com/vakata)

---

Top Contributors

[![vakata](https://avatars.githubusercontent.com/u/146052?v=4)](https://github.com/vakata "vakata (6 commits)")

---

Tags

databasemigratevakata

### Embed Badge

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

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

###  Alternatives

[doctrine/dbal

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

9.7k605.0M6.8k](/packages/doctrine-dbal)[doctrine/doctrine-bundle

Symfony DoctrineBundle

4.8k254.4M4.1k](/packages/doctrine-doctrine-bundle)[doctrine/migrations

PHP Doctrine Migrations project offer additional functionality on top of the database abstraction layer (DBAL) for versioning your database schema and easily deploying changes to it. It is a very easy to use and a powerful tool.

4.8k217.3M548](/packages/doctrine-migrations)[doctrine/data-fixtures

Data Fixtures for all Doctrine Object Managers

2.9k143.6M585](/packages/doctrine-data-fixtures)[spatie/laravel-backup

A Laravel package to backup your application

6.0k24.4M242](/packages/spatie-laravel-backup)[illuminate/database

The Illuminate Database package.

2.8k54.9M11.6k](/packages/illuminate-database)

PHPackages © 2026

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