PHPackages                             cubadevops/dbmigrator - 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. cubadevops/dbmigrator

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

cubadevops/dbmigrator
=====================

Simple PHP Version Control(migration system) for databases

1.0.1(3y ago)17MITPHP

Since Oct 12Pushed 3y ago1 watchersCompare

[ Source](https://github.com/cbatista8a/dbmigrator)[ Packagist](https://packagist.org/packages/cubadevops/dbmigrator)[ RSS](/packages/cubadevops-dbmigrator/feed)WikiDiscussions master Synced today

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

dbmigrator
==========

[](#dbmigrator)

Simple Control Version System for Databases

### How to Integrate on your Project or in a single module/plugin directory inside your project

[](#how-to-integrate-on-your-project-or-in-a-single-moduleplugin-directory-inside-your-project)

First require autoload.php

`require_once './vendor/autoload.php';`

Then configure the connection to your database

`$connection = new Connection('localhost', '3306', 'root', 'root', 'test', 'mysql');`

Configure your migration path and the name of the migrations version table

`$configurator = new Configurator($connection, __DIR__.'/migrations_dir', 'migrations_version_table');`

Finally create the migrator manager

`$migrator = new Migrator($configurator);`

### How to use

[](#how-to-use)

First you must create a migration class that extend of Migration or just implement Migration interface if you use a simple plain query inside "up" and "down" methods

```
use CubaDevOps\DbMigrator\domain\Migration;
use Illuminate\Database\Capsule\Manager;
use Illuminate\Database\Schema\Blueprint;

class MigrationTest extends Migration
{

    public function up(): void
    {
        Manager::schema()->create('migration_example_table',function (Blueprint $table){
            $table->increments('id');
            $table->string('content')->default('test');
            // others columns
        });
    }

    public function down(): void
    {
        Manager::schema()->dropIfExists('migration_example_table');
    }
}
```

### How to Run Pending migrations

[](#how-to-run-pending-migrations)

`$migrator->migrate();`

### How rollback migrations

[](#how-rollback-migrations)

`$migrator->rollback();`

### How to Run a Fresh version of your entire migrations

[](#how-to-run-a-fresh-version-of-your-entire-migrations)

`$migrator->fresh();`

This is the same that do:

`$migrator->rollback();`and then `$migrator->migrate();`

You are welcome to contribute to this project with new features or bug fixes, just make a "pull request" on a new branch.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity48

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

Total

2

Last Release

1352d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/40b582c610d5d33636fea13fd72a9a8012820ed5c4d30afda8eeb5c4736382f4?d=identicon)[cbatista8a](/maintainers/cbatista8a)

---

Top Contributors

[![cbatista8a](https://avatars.githubusercontent.com/u/59052959?v=4)](https://github.com/cbatista8a "cbatista8a (15 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP CS Fixer

### Embed Badge

![Health badge](/badges/cubadevops-dbmigrator/health.svg)

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

###  Alternatives

[mongodb/laravel-mongodb

A MongoDB based Eloquent model and Query builder for Laravel

7.1k8.4M94](/packages/mongodb-laravel-mongodb)[yajra/laravel-oci8

Oracle DB driver for Laravel via OCI8

8793.2M25](/packages/yajra-laravel-oci8)[psalm/plugin-laravel

Psalm plugin for Laravel

3355.3M346](/packages/psalm-plugin-laravel)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.3M19](/packages/bavix-laravel-wallet)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2051.5M2](/packages/glushkovds-phpclickhouse-laravel)[rector/rector-src

Instant Upgrade and Automated Refactoring of any PHP code

136406.3k14](/packages/rector-rector-src)

PHPackages © 2026

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