PHPackages                             farisc0de/phpmigration - 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. farisc0de/phpmigration

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

farisc0de/phpmigration
======================

Enterprise-ready database migration library for PHP with fluent schema builder, versioning, CLI tools, and multi-database support

v3.0.0(4mo ago)115MITPHPPHP &gt;=8.1

Since Apr 29Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/farisc0de/PhpMigration)[ Packagist](https://packagist.org/packages/farisc0de/phpmigration)[ Docs](https://github.com/farisc0de/PhpMigration)[ RSS](/packages/farisc0de-phpmigration/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (3)Dependencies (3)Versions (4)Used By (0)

PhpMigration
============

[](#phpmigration)

Enterprise-ready database migration library for PHP with fluent schema builder, versioning, CLI tools, and multi-database support.

[![PHP Version](https://camo.githubusercontent.com/04744bae0a61d2ffe29c26f07a9612eae20445fc6feaeb77b3af1f0e9be6447c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d253345253344382e312d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](LICENSE)

Features
--------

[](#features)

- **Fluent Schema Builder** - Laravel-like Blueprint API for defining tables
- **Migration Versioning** - Track and manage migration history with batches
- **CLI Tools** - Full command-line interface for all migration operations
- **Multi-Database Support** - MySQL, PostgreSQL, and SQLite drivers
- **Database Seeding** - Populate your database with test or initial data
- **Schema Introspection** - Inspect existing database structure
- **Event System** - Hook into migration lifecycle events
- **PSR-3 Logging** - Compatible logging implementation
- **Environment Configuration** - Support for `.env` files

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

[](#requirements)

- PHP 8.1 or higher
- PDO extension
- One of: pdo\_mysql, pdo\_pgsql, or pdo\_sqlite

Installation
------------

[](#installation)

```
composer require farisc0de/phpmigration
```

Quick Start
-----------

[](#quick-start)

### 1. Create Configuration

[](#1-create-configuration)

Create a `.env` file in your project root:

```
DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=your_database
DB_USERNAME=your_username
DB_PASSWORD=your_password
```

Or create `config/database.php`:

```
