PHPackages                             darkfriend/yii2-data-migrate - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. darkfriend/yii2-data-migrate

ActiveYii2-extension[Testing &amp; Quality](/categories/testing)

darkfriend/yii2-data-migrate
============================

RBAC management module for Yii2

1.0.1(5y ago)1886MITPHPPHP &gt;=7.0.0

Since Feb 23Pushed 5y ago1 watchersCompare

[ Source](https://github.com/darkfriend/yii2-data-migrate)[ Packagist](https://packagist.org/packages/darkfriend/yii2-data-migrate)[ Docs](https://github.com/darkfriend/php7-helpers)[ RSS](/packages/darkfriend-yii2-data-migrate/feed)WikiDiscussions master Synced 1mo ago

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

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

Yii2 Test Data Migrate Extension
================================

[](#yii2-test-data-migrate-extension)

Yii2-Data-Migrate provides a test data control.

[![Latest Stable Version](https://camo.githubusercontent.com/827df96e5ce70b0496f5b516b9712517f6c6bcb48d62548767d308eba899a5b4/68747470733a2f2f706f7365722e707567782e6f72672f6461726b667269656e642f796969322d646174612d6d6967726174652f762f737461626c65)](https://packagist.org/packages/darkfriend/yii2-data-migrate) [![Total Downloads](https://camo.githubusercontent.com/9e0f68564a5a2bd7a0306dd9a2f3f3c615313b62a96836941a412d575eb28c42/68747470733a2f2f706f7365722e707567782e6f72672f6461726b667269656e642f796969322d646174612d6d6967726174652f646f776e6c6f616473)](https://packagist.org/packages/darkfriend/yii2-data-migrate) [![License](https://camo.githubusercontent.com/38909d098c5fe9d40d010824ec836cec6da6dfde3136f0195277decf5284869b/68747470733a2f2f706f7365722e707567782e6f72672f6461726b667269656e642f796969322d646174612d6d6967726174652f6c6963656e7365)](https://packagist.org/packages/darkfriend/yii2-data-migrate)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist darkfriend/yii2-data-migrate "*"

```

or add

```
"darkfriend/yii2-data-migrate": "*"

```

to the require section of your composer.json.

Usage
-----

[](#usage)

Once the extension is installed, simply modify your application configuration as follows:

```
return [
    'bootstrap' => ['data'],
    'modules' => [
        'data' => [
            'class' => 'darkfriend\yii2migrate\ConsoleModule',
        ],
    ],
];
```

After you downloaded and configured Yii2-data-migrate, the last thing you need to do is updating your database schema by applying the migration:

```
$ php yii data/migrate/up
```

Migrations are located in the `data-migrations` directory.

Migrations
----------

[](#migrations)

You can create the console migrations for creating/updating RBAC items.

### Module setup

[](#module-setup)

To be able create the migrations, you need to add the following code to your console application configuration:

```
// console.php
'modules' => [
    'data' => [
        'class' => 'darkfriend\yii2migrate\ConsoleModule'
    ]
]
```

### Creating Migrations

[](#creating-migrations)

To create a new migration, run the following command:

```
$ php yii data/migrate/create
```

The required `name` argument gives a brief description about the new migration. For example, if the migration is about creating a new migrate, you may use the name `create_migrate_name` and run the following command:

```
$ php yii data/migrate/create create_migrate_name
```

### Applying Migrations

[](#applying-migrations)

To upgrade a database to its latest structure, you should apply all available new migrations using the following command:

```
$ php yii data/migrate
```

### Reverting Migrations

[](#reverting-migrations)

To revert (undo) one or multiple migrations that have been applied before, you can run the following command:

```
$ php yii data/migrate/down     # revert the most recently applied migration
$ php yii data/migrate/down 3   # revert the most 3 recently applied migrations
```

### Redoing Migrations

[](#redoing-migrations)

Redoing migrations means first reverting the specified migrations and then applying again. This can be done as follows:

```
$ php yii data/migrate/redo     # redo the last applied migration
$ php yii data/migrate/redo 3   # redo the last 3 applied migrations
```

### History Migrations

[](#history-migrations)

```
$ php yii data/migrate/history     # show all applied migration
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity53

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

Every ~89 days

Total

3

Last Release

2091d ago

Major Versions

0.0.1 → 1.0.02020-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/302f1cdc7cb85fc89550bad0c164e195b831f50de8a2a148fa754670d5f328cc?d=identicon)[darkfriend](/maintainers/darkfriend)

---

Top Contributors

[![darkfriend](https://avatars.githubusercontent.com/u/7825114?v=4)](https://github.com/darkfriend "darkfriend (6 commits)")

---

Tags

testingtestyii2yii2 moduleyii2-datadata migrate

### Embed Badge

![Health badge](/badges/darkfriend-yii2-data-migrate/health.svg)

```
[![Health](https://phpackages.com/badges/darkfriend-yii2-data-migrate/health.svg)](https://phpackages.com/packages/darkfriend-yii2-data-migrate)
```

###  Alternatives

[albertcht/lumen-testing

Testing Suite For Lumen like Laravel does.

4335.5k1](/packages/albertcht-lumen-testing)[sofa/eloquent-testsuite

Helpers for fast and reliable UNIT tests for your Eloquent Models with PHPUnit

10104.7k](/packages/sofa-eloquent-testsuite)

PHPackages © 2026

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