PHPackages                             wijoc/mi-grator - 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. wijoc/mi-grator

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

wijoc/mi-grator
===============

A stand alone database migration for PHP and Wordpress.

0.1.0(9mo ago)01MITPHPPHP ^7.4 || ^8.0 || ^8.1 || ^8.2

Since Aug 7Pushed 9mo agoCompare

[ Source](https://github.com/wijoc/mi-grator)[ Packagist](https://packagist.org/packages/wijoc/mi-grator)[ RSS](/packages/wijoc-mi-grator/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

MI-Grator
=========

[](#mi-grator)

Extra Package PHP Database Migration that is compatible with procedural PHP and WordPress. This project provides a database migration specifically for WordPress projects. Heavily influenced by Laravel and/or Symfony migration and inspired by CakePHP/Phinx [cakephp/phinx](https://github.com/cakephp/phinx), this project originated from a personal need and is still in beta development. All inputs are highly appreciated.

---

📦 Features
----------

[](#-features)

- Create, Migrate and rollback migration
- PHP CLI support (`vendor/bin/mi-grator`)
- Native WordPress CLI (`wp mi-grator`) support
- Supported commands to make migration, migrate new migration, and/or reset migration

---

🧩 Dependencies
--------------

[](#-dependencies)

- PHP 7.4+ or 8.x
- Composer (for autoloading)
- Symfony Console[symfony/console](https://github.com/symfony/console) (for cli command)
- PHP dotenv[vlucas/phpdotenv](https://github.com/vlucas/phpdotenv) (for loading .env file)
- [WP-CLI](https://wp-cli.org/) (for WordPress command-line integration)
- WordPress (optional, only for WP CLI support)

Autoloading and command registration are handled automatically via Composer.

---

📁 Project Directory Structure (after installation directories)
--------------------------------------------------------------

[](#-project-directory-structure-after-installation-directories)

```
your-project
├── migrations/
│ ├── 2025_08_07_000000_create_user_table.php
│ └── 2025_08_07_000000_create_user_detail_table.php
├── vendor/
│ ├── wijoc/mi-grator
│ │ ├── Commands
│ │ └── Migrations
| ├── Kernel.php
│ └── QueryBuilder.php

```

---

🧰 Requirements
--------------

[](#-requirements)

- WordPress 6.2+
- PHP 8.0+

---

🚧 Installation
--------------

[](#-installation)

1. You can install the library via Composer:

```
composer  require  wijoc/mi-grator
```

or copy from this repository and move it to your project directory

```
git clone git@github.com:wijoc/validify-mi.git
mv wijoc/mi-grator /project-dir
```

2. Set env or constant for migration table name and migration path

```
DB_HOST={your_databe_host}
DB_USER={your_databe_username}
DB_PASSWORD={your_databe_password}
DB_NAME={your_databe_name}

MIGRATION_TABLE={your_migration_table_name} # By default this will set to 'migration'
MIGRATION_FILE_PATH={your_migration_table_name} # By default this will set to directory ./migrations
```

Usage
-----

[](#usage)

### 💻 In Plain PHP (non-WordPress)

[](#-in-plain-php-non-wordpress)

Use the CLI binary provided:

```
./vendor/bin/mygrator make:migration create_users_table --table=users
./vendor/bin/mygrator migrate
./vendor/bin/mygrator migrate:fresh
./vendor/bin/mygrator migrate:rollback
./vendor/bin/mygrator migrate:reset
```

You can include these in your deployment scripts, CI/CD pipelines, or setup scripts.

### 🧩 In WordPress (via WP-CLI)

[](#-in-wordpress-via-wp-cli)

If you're using WordPress and WP-CLI, and your theme/plugin loads vendor/autoload.php, you're ready to go:

```
wp mi-grator make:migration create_users_table --table=users
wp mi-grator migrate
wp mi-grator migrate:rollback
```

⚠️ Ensure your theme or plugin loads Composer autoloader:

```
require_once **DIR** . '/vendor/autoload.php';
```

You can also use a must-use plugin (mu-plugin) to include the autoloader automatically if you're building a distributable plugin.

---

📃 License
---------

[](#-license)

MIT License

---

---

🤝 Contributions
---------------

[](#-contributions)

Pull requests are welcome! If you find a bug or have a feature request, feel free to open an issue.

---

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance58

Moderate activity, may be stable

Popularity1

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

277d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0f5602b603fd1e3192207c360a5375251afaa51a6eecd93ad2d94a372d7630c3?d=identicon)[wijozoe](/maintainers/wijozoe)

---

Top Contributors

[![wijoc](https://avatars.githubusercontent.com/u/55661500?v=4)](https://github.com/wijoc "wijoc (1 commits)")

### Embed Badge

![Health badge](/badges/wijoc-mi-grator/health.svg)

```
[![Health](https://phpackages.com/badges/wijoc-mi-grator/health.svg)](https://phpackages.com/packages/wijoc-mi-grator)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M189](/packages/spatie-laravel-backup)[worksome/foggy

Foggy is a tool for making database dumps with some data removed/changed.

26571.7k1](/packages/worksome-foggy)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

255.2k](/packages/aedart-athenaeum)[psx/sql

Generate type-safe PHP classes from your database

1773.4k4](/packages/psx-sql)[cable8mm/xeed

The Xeed is to generate new model, seed, Nova resource, database seed, factory and migration files for Laravel &amp; Nova based on data from the existing database table.

872.4k](/packages/cable8mm-xeed)[byjg/migration-cli

Simple library in PHP for database version control. Supports Sqlite, MySql, Sql Server and Postgres.

1025.2k](/packages/byjg-migration-cli)

PHPackages © 2026

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