phpolar / mysql-migrations
Adds support for running migrations against a MySql database.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 1
pkg:composer/phpolar/mysql-migrations
Requires
- php: >=8.4
- ext-pdo_mysql: *
- phpolar/migrations: ^1.0.0
Requires (Dev)
- ext-ast: *
- ext-openssl: *
- phan/phan: ^5.4
- php-coveralls/php-coveralls: ^2.5
- phpmd/phpmd: ^2.13
- phpstan/phpstan: ^2.0.3
- phpunit/phpunit: ^12
- squizlabs/php_codesniffer: ^4
This package is auto-updated.
Last update: 2025-12-15 19:29:12 UTC
README

PHPolar MySql Migrations
Adds support for running migrations against a MySql database.
PHPolar Migration Runner (for MySqL)
DESCRIPTION
A command line tool that supports database migration management
USAGE
mysqlmi [options] command
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
directory - The directory that contains the migrations
OPTIONS
-h, --help Display this help message
-n, --name The name of the migration to create
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
"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
mysqlmi --name CreateProductTable create ./migrations
mysqlmi run ./migrations
mysqlmi revert