PHPackages                             ignitekit/wp-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. ignitekit/wp-migrations

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

ignitekit/wp-migrations
=======================

Laravel inspired database migrations for WordPress

1.0.0(5y ago)0281[1 issues](https://github.com/IgniteKit/wp-migrations/issues)MITPHPPHP &gt;=7.0

Since Sep 26Pushed 5y ago1 watchersCompare

[ Source](https://github.com/IgniteKit/wp-migrations)[ Packagist](https://packagist.org/packages/ignitekit/wp-migrations)[ RSS](/packages/ignitekit-wp-migrations/feed)WikiDiscussions master Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

WP Migrations
=============

[](#wp-migrations)

#### Migrations for WordPress inspired by Laravel.

[](#migrations-for-wordpress-inspired-by-laravel)

The package can be used in different plugins in the same time if you create your own `BaseMigration` in each plugin.

Follow the steps before to properly setup the package.

### Instructions

[](#instructions)

1.) Create base class called `BaseMigration`

```
namespace MyPlugin\Database\Migrations;

use IgniteKit\WP\Migrations\Engine\Migration;
use IgniteKit\WP\Migrations\Contracts\Migration as MigrationContract;

class BaseMigration extends Migration implements MigrationContract {

    /**
     * Specify custom migrations table
     * @var string
     */
    protected $migrationsTableName = 'your_migrations_table';

}
```

2.) Create migrations table setup migration. eg `SetupMigrations`

```
namespace MyPlugin\Database\Migrations;

use IgniteKit\WP\Migrations\Engine\Setup;

class CreateMigrationsTable extends BaseMigration {
	use Setup;
}
```

3.) You can now create your own custom migrations. In this case create the `fruits` table.

```
namespace MyPlugin\Database\Migrations;

use IgniteKit\WP\Migrations\Database\Blueprint;
use IgniteKit\WP\Migrations\Wrappers\Schema;

class CreateFruitsTable extends BaseMigration {

	/**
	 * Put the table up
	 *
	 * @return void
	 */
	public function up() {
		Schema::create( 'fruits', function ( Blueprint $table ) {
			$table->bigIncrements( 'id' );
			$table->string( 'name' );
		} );
	}

	/**
	 * Default down function
	 *
	 * @return void
	 */
	public function down() {
		Schema::drop( 'fruits' );
	}

}
```

4.) Finally, register those migrations

```
/**
 * Registers the plugin migrations
 * @return void
 */
function my_plugin_register_migrations() {

    // Boot the CLI interface
    if(!class_exists('\IgniteKit\WP\Migrations\CLI\Boot')) {
        return;
    }
    \IgniteKit\WP\Migrations\CLI\Boot::start();

    // Register the migrations table migration
    CreateMigrationsTable::register();

    // Register the other migrations
    // NOTE: The squence is important!
    CreateFruitsTable::register();
    // ... other

}
add_action('plugins_loaded', 'my_plugin_register_migrations');
```

### Creating columns

[](#creating-columns)

You can create a lot of different column types with Table Migrations. Here's a list:

CommandDescription$table-&gt;bigInteger('votes');BIGINT equivalent for the database.$table-&gt;binary('data');BLOB equivalent for the database.$table-&gt;boolean('confirmed');BOOLEAN equivalent for the database.$table-&gt;char('name', 4);CHAR equivalent with a length.$table-&gt;date('created\_at');DATE equivalent for the database.$table-&gt;dateTime('created\_at');DATETIME equivalent for the database.$table-&gt;decimal('amount', 5, 2);DECIMAL equivalent with a precision and scale.$table-&gt;double('column', 15, 8);DOUBLE equivalent with precision, 15 digits in total and 8 after the decimal point.$table-&gt;float('amount', 8, 2);FLOAT equivalent for the database, 8 digits in total and 2 after the decimal point.$table-&gt;increments('id');Incrementing ID (primary key) using a "UNSIGNED INTEGER" equivalent.$table-&gt;bigIncrements('id');Incrementing ID (primary key) using a "UNSIGNED BIGINT" equivalent.$table-&gt;smallIncrements('id');Incrementing ID (primary key) using a "UNSIGNED SMALLINT" equivalent.$table-&gt;mediumIncrements('id');Incrementing ID (primary key) using a "UNSIGNED MEDIUMINT" equivalent.$table-&gt;integer('votes');INTEGER equivalent for the database.$table-&gt;longText('description');LONGTEXT equivalent for the database.$table-&gt;mediumInteger('numbers');MEDIUMINT equivalent for the database.$table-&gt;mediumText('description');MEDIUMTEXT equivalent for the database.$table-&gt;smallInteger('votes');SMALLINT equivalent for the database.$table-&gt;string('email');VARCHAR equivalent column.$table-&gt;string('name', 100);VARCHAR equivalent with a length.$table-&gt;text('description');TEXT equivalent for the database.$table-&gt;time('sunrise');TIME equivalent for the database.$table-&gt;tinyInteger('numbers');TINYINT equivalent for the database.$table-&gt;timestamp('added\_on');TIMESTAMP equivalent for the database.---

### Contributions

[](#contributions)

If you are interested in contributing to the project. Feel free to submit your issue or pull request.

### License

[](#license)

```
Copyright (C) 2020 Darko Gjorgjijoski (https://darkog.com)

This file is part of wp-migrations

WP Migrations is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

WP Migrations  is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with WP Migrations. If not, see .

```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity49

Maturing project, gaining track record

 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

2059d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a1965873ac504089410d74b549978508bae3f246520df66c53b229cb138ebc20?d=identicon)[IgniteKit](/maintainers/IgniteKit)

---

Top Contributors

[![gdarko](https://avatars.githubusercontent.com/u/5760249?v=4)](https://github.com/gdarko "gdarko (3 commits)")

### Embed Badge

![Health badge](/badges/ignitekit-wp-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/ignitekit-wp-migrations/health.svg)](https://phpackages.com/packages/ignitekit-wp-migrations)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

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