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

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

phpolar/mysql-migrations
========================

Adds support for running migrations against a MySql database.

1.0.2(5mo ago)0123[2 PRs](https://github.com/phpolar/mysql-migrations/pulls)MITPHPPHP &gt;=8.4CI passing

Since Dec 15Pushed 1mo agoCompare

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

READMEChangelogDependencies (7)Versions (11)Used By (0)

 [![Application Logo](./phpolar.svg)](./phpolar.svg)
 PHPolar MySql Migrations
===============================================================================

[](#--------phpolar-mysql-migrations)

Adds support for running migrations against a MySql database.

 [ ![Coverage Status](https://camo.githubusercontent.com/4b85a1b0c6c9399051945610629baf0acfc2b803391c2d0ef2b6d52bdf4b54da/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f7068706f6c61722f6d7973716c2d6d6967726174696f6e732f62616467652e7376673f6272616e63683d6d61696e) ](https://coveralls.io/github/phpolar/mysql-migrations?branch=main) [ ![Latest Stable Version](https://camo.githubusercontent.com/27a011b72b06191786475e8ffa739f6f0b952c2209b9c06a59d6da80c793ea3f/687474703a2f2f706f7365722e707567782e6f72672f7068706f6c61722f6d7973716c2d6d6967726174696f6e732f76) ](https://packagist.org/packages/phpolar/mysql-migrations) [ ![Total Downloads](https://camo.githubusercontent.com/234cf664f358ecaf36b5f7b2a526b248334635f0f9762ae17d901ad0d74d2486/687474703a2f2f706f7365722e707567782e6f72672f7068706f6c61722f6d7973716c2d6d6967726174696f6e732f646f776e6c6f616473) ](https://packagist.org/packages/phpolar/mysql-migrations) [ ![License](https://camo.githubusercontent.com/c4f3285389af82da66d79d18d1751ee452e0c20bb9fbc9d06470d7f1112ccfe8/687474703a2f2f706f7365722e707567782e6f72672f7068706f6c61722f6d7973716c2d6d6967726174696f6e732f6c6963656e7365) ](https://packagist.org/packages/phpolar/mysql-migrations) [ ![PHP Version Require](https://camo.githubusercontent.com/c7aa98dfc2bb694d5a6355f1c75ed2b2560ae10e08bd7272f1aba183a0585ae1/687474703a2f2f706f7365722e707567782e6f72672f7068706f6c61722f6d7973716c2d6d6967726174696f6e732f726571756972652f706870) ](https://packagist.org/packages/phpolar/mysql-migrations)

PHPolar Migration Runner (for MySqL)
====================================

[](#phpolar-migration-runner-for-mysql)

DESCRIPTION
-----------

[](#description)

```
A command line tool that supports database migration management

```

USAGE
-----

[](#usage)

```
mysqlmi [options] command

```

AVAILABLE COMMANDS
------------------

[](#available-commands)

```
create -  Generates a stub migration in the specified directory
run    -  Executes all pending database migrations located in the specified directory
revert -  Reverts the last successfully run migration

```

ARGUMENTS
---------

[](#arguments)

```
directory -  The directory that contains the migrations

```

OPTIONS
-------

[](#options)

```
-h, --help Display this help message
-n, --name The name of the migration to create

```

SETUP
-----

[](#setup)

```
Create a connection.php file in your working directory that returns an instance of PDO.
Specify the directory containing the migrations when running the run -  or create command.
If a directory is not supplied, the script will use a migrations folder in the working directory.

```

CREATING A MIGRATION
--------------------

[](#creating-a-migration)

```
"Migration" and a 13 digit timestamp will be prepended to the filename.
For example, mysqlmi --name CreateProductTable create ./migrations
will generate a file named Migration1764993752674CreateProductTable.php
in the migrations folder.

```

EXAMPLES
--------

[](#examples)

```
mysqlmi --name CreateProductTable create ./migrations
mysqlmi run ./migrations
mysqlmi revert

```

###  Health Score

43

—

FairBetter than 91% of packages

Maintenance83

Actively maintained with recent releases

Popularity10

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% 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 ~2 days

Total

3

Last Release

151d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/6f34e51c09f71ccba1670d080b700e489cc2cffd43f4bed7684af4dff0195732?d=identicon)[phpolar](/maintainers/phpolar)

---

Top Contributors

[![ericfortmeyer](https://avatars.githubusercontent.com/u/40972462?v=4)](https://github.com/ericfortmeyer "ericfortmeyer (15 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (8 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (7 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90440.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)[wildside/userstamps

Laravel Userstamps provides an Eloquent trait which automatically maintains `created\_by` and `updated\_by` columns on your model, populated by the currently authenticated user in your application.

7511.7M13](/packages/wildside-userstamps)

PHPackages © 2026

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