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 1mo ago

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 22% 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

1299d 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

[owen-it/laravel-auditing

Audit changes of your Eloquent models in Laravel

3.4k33.0M95](/packages/owen-it-laravel-auditing)[staudenmeir/eloquent-json-relations

Laravel Eloquent relationships with JSON keys

1.1k5.8M24](/packages/staudenmeir-eloquent-json-relations)[bavix/laravel-wallet

It's easy to work with a virtual wallet.

1.3k1.1M11](/packages/bavix-laravel-wallet)[dragon-code/migrate-db

Easy data transfer from one database to another

15717.4k](/packages/dragon-code-migrate-db)[gearbox-solutions/eloquent-filemaker

A package for getting FileMaker records as Eloquent models in Laravel

6454.8k2](/packages/gearbox-solutions-eloquent-filemaker)[cybercog/laravel-ownership

Laravel Ownership simplify management of Eloquent model's owner.

9126.6k3](/packages/cybercog-laravel-ownership)

PHPackages © 2026

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