PHPackages                             drago-ex/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. [CLI &amp; Console](/categories/cli)
4. /
5. drago-ex/migration

ActiveLibrary[CLI &amp; Console](/categories/cli)

drago-ex/migration
==================

A simple CLI tool for running SQL migrations.

v1.0.0(4mo ago)016MITPHPPHP &gt;=8.3 &lt;9CI passing

Since Dec 30Pushed 4mo agoCompare

[ Source](https://github.com/drago-ex/migration)[ Packagist](https://packagist.org/packages/drago-ex/migration)[ RSS](/packages/drago-ex-migration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (6)Versions (2)Used By (0)

Drago Migration
---------------

[](#drago-migration)

A simple CLI tool for running SQL migrations.

Drago Migration is a lightweight CLI tool built on Nette, Dibi and Symfony Console. It allows you to run SQL migrations from files or directories with checksum validation, transactional execution and database-level locking.

[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://raw.githubusercontent.com/drago-ex/migration/main/license)[![PHP version](https://camo.githubusercontent.com/732c0d3857e03fa46e39a7a8c50a9400151518cdd0e4cbf3c97ae7c3c2772066/68747470733a2f2f62616467652e667572792e696f2f70682f647261676f2d65782532466d6967726174696f6e2e737667)](https://badge.fury.io/ph/drago-ex%2Fmigration)[![Coding Style](https://github.com/drago-ex/migration/actions/workflows/coding-style.yml/badge.svg)](https://github.com/drago-ex/migration/actions/workflows/coding-style.yml)

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- Nette Framework
- Symfony Console
- dibi
- Composer

Install
-------

[](#install)

```
composer require drago-ex/migration
```

Register Migration Extension in Nette
-------------------------------------

[](#register-migration-extension-in-nette)

```
extensions:
    migration: Drago\Migration\DI\MigrationExtension(%consoleMode%)
    console: Contributte\Console\DI\ConsoleExtension(%consoleMode%)

# symfony console
console:
	name: Symfony Console
	version: '1.0'
```

Make sure the %consoleMode% parameter is available (usually already present in Nette CLI setups).

Database Setup
--------------

[](#database-setup)

Create the migrations table in your database:

```
CREATE TABLE IF NOT EXISTS migrations (
    id INT AUTO_INCREMENT PRIMARY KEY,
    package VARCHAR(255) NOT NULL,
    migration_file VARCHAR(255) NOT NULL,
    checksum CHAR(40) NOT NULL,
    executed_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
    CONSTRAINT uq_migrations_package_file
        UNIQUE (package, migration_file)
)
    ENGINE = InnoDB
    DEFAULT CHARSET = utf8mb4
    COLLATE = utf8mb4_unicode_ci;
```

Usage
-----

[](#usage)

Run migrations using the Composer-installed binary:

```
php vendor/bin/migration db:migrate
```

Path to a single SQL file or a directory containing multiple .sql files.

Examples
--------

[](#examples)

```
# Run all migrations in a folder
php vendor/bin/migration db:migrate migrations

# Run a single migration file
php vendor/bin/migration db:migrate migrations/001_example.sql
```

Features
--------

[](#features)

- Checksum validation – detects modified migrations
- Transactional execution – safe rollback on failure
- Database locking – prevents concurrent runs
- Package-aware migrations – supports vendor-based migrations
- Symfony Console integration – clean CLI output

Notes
-----

[](#notes)

- This package is designed for Nette Framework projects.
- The provided CLI binary expects a Nette project structure with app/Bootstrap.php.
- For non-Nette projects, a custom bootstrap script is required.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance76

Regular maintenance activity

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity49

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

Unknown

Total

1

Last Release

139d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/5998929?v=4)[Zdeněk Papučík](/maintainers/accgit)[@accgit](https://github.com/accgit)

---

Top Contributors

[![accgit](https://avatars.githubusercontent.com/u/5998929?v=4)](https://github.com/accgit "accgit (24 commits)")

### Embed Badge

![Health badge](/badges/drago-ex-migration/health.svg)

```
[![Health](https://phpackages.com/badges/drago-ex-migration/health.svg)](https://phpackages.com/packages/drago-ex-migration)
```

###  Alternatives

[wp-cli/wp-cli

WP-CLI framework

5.0k17.2M320](/packages/wp-cli-wp-cli)[consolidation/annotated-command

Initialize Symfony Console commands from annotated command class methods.

22569.8M19](/packages/consolidation-annotated-command)[chi-teck/drupal-code-generator

Drupal code generator

26947.8M5](/packages/chi-teck-drupal-code-generator)[seld/cli-prompt

Allows you to prompt for user input on the command line, and optionally hide the characters they type

24725.8M17](/packages/seld-cli-prompt)[illuminate/console

The Illuminate Console package.

12944.1M5.1k](/packages/illuminate-console)[php-tui/php-tui

Comprehensive TUI library heavily influenced by Ratatui

589747.0k6](/packages/php-tui-php-tui)

PHPackages © 2026

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