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

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

luxbet/mysql-php-migrations
===========================

Command line utility for managing MySQL database migrations

3237PHP

Since Sep 9Pushed 9y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

This project was created to address the problem of maintaining database changes within an actively developed PHP/MySQL project. Frequently, multiple developers need to be able to quickly update their local sandboxes with the latest DB schema changes and also add their own without creating file conflicts in repositories such as CVS and Subversion.

MySQL-PHP-Migrations includes the following features:
-----------------------------------------------------

[](#mysql-php-migrations-includes-the-following-features)

- command-line only utility
- migration files are stored using timestamps to reduce repository conflicts
- ability to list, migrate up, migrate down, run a specific migration, and migrate to latest database version
- each migration is wrapped in a transaction to ease error recovery
- migration information stored in database table to support interleaving (insertion of migrations between migrations that have already been run)
- in-line help
- support for PDO with MySQL driver or mysqli
- can store an initial DB schema which allows entire database structure to be erased and rebuilt from an initial schema and existing migrations

New changes by 2.2.0-luxbet:
----------------------------

[](#new-changes-by-220-luxbet)

- --dry-run / -p support: try out without any database changes
- migration files can be grouped by put under separate folders under /db (when using ./migrate.php add, it is still put under /db directly, but you can move them around later)
- an SQL log file (log.sql) for all the SQL from migration files of last run
- fix bugs and a little nicer CLI prompt
- You can redefine `MPM_PATH` and `MPM_CONFIG_FILE_PATH` so you can share one installation across multiple projects

```
#!/usr/bin/env php
