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(6mo ago)0126[2 PRs](https://github.com/phpolar/mysql-migrations/pulls)MITPHPPHP &gt;=8.4CI passing

Since Dec 15Pushed 2mo 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 today

READMEChangelogDependencies (7)Versions (14)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

42

—

FairBetter than 88% of packages

Maintenance78

Regular maintenance activity

Popularity11

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity60

Established project with proven stability

 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

196d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/122765967?v=4)[phpolar](/maintainers/phpolar)[@phpolar](https://github.com/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

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k117.2M118](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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