PHPackages                             barney-k/yii2-migration-module - 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. barney-k/yii2-migration-module

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

barney-k/yii2-migration-module
==============================

Yii2 module for managing migrations

012PHP

Since Feb 23Pushed 10y ago1 watchersCompare

[ Source](https://github.com/barney-k/yii2-migration-module)[ Packagist](https://packagist.org/packages/barney-k/yii2-migration-module)[ RSS](/packages/barney-k-yii2-migration-module/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

yii2-migration-module
=====================

[](#yii2-migration-module)

A module for Yii2 framework to create and manage migration files without CLI

Installation
============

[](#installation)

Two-step installation with **composer**.

> This instructions assumes that you have **composer** installed and **db** configured for your Yii2 application.

Step 1: Download using composer
-------------------------------

[](#step-1-download-using-composer)

Add **yii2-migration-module** to the require section of your **composer.json** file:

```
{
    "require": {
        "barney-k/yii2-migration-module": "dev-master"
    }
}
```

And run following command to download extension using **composer**:

```
$ php composer.phar update
```

OR

```
$ php composer.phar require barney-k/yii2-migration-module "dev-master"
```

Step 2: Configure your application
----------------------------------

[](#step-2-configure-your-application)

Add migration module to both web config files (or backend config if you're using advanced templating) as follows:

```
...
'modules' => [
    ...
    'migration' => [
        'class' => 'barneyk\migration\MigrationModule',
    ],
    ...
],
...
```

Configuration
=============

[](#configuration)

You can configure the module by adding additional parameters to the config file after the **class** key:

- admins:
    - this is an array usernames, that can access this module
    - default: `[]`
- migrationPath:
    - path of the migration files
    - default: `'@vendor/barney-k/yii2-migration-module/migrations'`
- dateFormat:
    - php date format string for displaying the create and apply dates.
    - default: `'Y.m.d. H:i:s'`
- migrationTable:
    - name of the database table for the migrations
    - default: `'migration'`

Example:
--------

[](#example)

```
...
'migration' => [
	'class' => 'barneyk\migration\MigrationModule',
	'admins' => ['root','admin','johndoe'],
	'migrationPath' => '@app/migrations',
	'dateFormat' => 'd/m/Y H:i:s',
	'migrationTable' => 'my_migrations',
],
...
```

Usage:
======

[](#usage)

- Create a new migration file
- Open up the generated file from the **migrationPath**
- Write your migration code. [Guide about migrations](http://www.yiiframework.com/doc-2.0/guide-db-migrations.html)
- Save the file
- Click on the migration's name in the migration list
- You can see the interactions that you can do with that migration under the details table

Features:
=========

[](#features)

- Generates migration files without CLI
- Indicates that if it's already applied or not
- Applies only one migration
- Applies more migrations up to a specific one
- Marks a migration as done
- Marks a migration as undone
- Redos a specific migration
- Reverts a specific migration
- Displays messages from the migration process just like the CLI would

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/17196169?v=4)[barney-k](/maintainers/barney-k)[@barney-k](https://github.com/barney-k)

---

Top Contributors

[![barney-k](https://avatars.githubusercontent.com/u/17196169?v=4)](https://github.com/barney-k "barney-k (22 commits)")

### Embed Badge

![Health badge](/badges/barney-k-yii2-migration-module/health.svg)

```
[![Health](https://phpackages.com/badges/barney-k-yii2-migration-module/health.svg)](https://phpackages.com/packages/barney-k-yii2-migration-module)
```

###  Alternatives

[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k116.5M113](/packages/jdorn-sql-formatter)[propel/propel1

Propel is an open-source Object-Relational Mapping (ORM) for PHP5.

8351.6M87](/packages/propel-propel1)[jfelder/oracledb

Oracle DB driver for Laravel

11518.4k](/packages/jfelder-oracledb)

PHPackages © 2026

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