PHPackages                             jamband/yii2-schemadump - 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. jamband/yii2-schemadump

AbandonedArchivedYii2-extension[Database &amp; ORM](/categories/database)

jamband/yii2-schemadump
=======================

Generate the schema from an existing database

v0.12.0(4y ago)8941.6k↓60%22[4 issues](https://github.com/jamband/yii2-schemadump/issues)2MITPHPPHP ^7.4|^8.0

Since Nov 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/jamband/yii2-schemadump)[ Packagist](https://packagist.org/packages/jamband/yii2-schemadump)[ Docs](https://github.com/jamband/yii2-schemadump)[ RSS](/packages/jamband-yii2-schemadump/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (2)Versions (14)Used By (2)

yii2-schemadump
===============

[](#yii2-schemadump)

[![Build Status](https://github.com/jamband/yii2-schemadump/workflows/tests/badge.svg)](https://github.com/jamband/yii2-schemadump/actions?workflow=tests) [![Latest Stable Version](https://camo.githubusercontent.com/d4896dd6c80fca8e5891eeda9f2d6b839bbfdf2745012437ad02fc5dacddcbad/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a616d62616e642f796969322d736368656d6164756d70)](https://packagist.org/packages/jamband/yii2-schemadump) [![Total Downloads](https://camo.githubusercontent.com/6114b9c9096bdce99515b0bddfa7e90a7f40aff7584910b4594babba9ed3a41c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a616d62616e642f796969322d736368656d6164756d70)](https://packagist.org/packages/jamband/yii2-schemadump)

Generate the schema from an existing database.

Demo
----

[](#demo)

[![gif](https://raw.githubusercontent.com/jamband/jamband.github.io/main/images/yii2-schemadump.gif)](https://raw.githubusercontent.com/jamband/jamband.github.io/main/images/yii2-schemadump.gif)

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

[](#requirements)

- PHP 7.4 or later
- Yii 2.x

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

[](#installation)

```
composer require --dev jamband/yii2-schemadump

```

Usage
-----

[](#usage)

Add the following in config/console.php:

```
return [
    ...
    'components' => [
        ...
    ],
    'controllerMap' => [
        'migrate' => [
            'class' => yii\console\controllers\MigrateController::class,
            'templateFile' => '@jamband/schemadump/template.php',
        ],
        'schemadump' => [
            'class' => jamband\schemadump\SchemaDumpController::class,
            'db' => [
                'class' => yii\db\Connection::class,
                'dsn' => 'mysql:host=localhost;dbname=existing_database_name',
                'username' => 'your_username',
                'password' => 'your_password',
            ],
        ],
    ],
    ...
];
```

And run `schemadump` command.

```
cd /path/to/project
./yii schemadump

```

Example output:

```
// user
$this->createTable('{{%user}}', [
    'id' => $this->primaryKey()->comment('主キー'),
    'username' => $this->string(20)->notNull()->unique()->comment('ユーザ名'),
    'email' => $this->string(255)->notNull()->unique()->comemnt('メールアドレス'),
    'password' => $this->string(255)->notNull()->comment('パスワード'),
], $this->tableOptions);
```

Copy the output code and paste it into a migration file.

Commands
--------

[](#commands)

Generates the 'createTable' code. (default)

```
./yii schemadump
./yii schemadump/create

```

Generates the 'dropTable' code.

```
./yii schemadump/drop

```

Useful commands (for macOS user):

```
./yii schemadump | pbcopy
./yii schemadump/drop | pbcopy

```

Check help.

```
./yii help schemadump

```

Supports
--------

[](#supports)

- Types
- Size
- Unsigned
- NOT NULL
- DEFAULT value
- COMMENT
- Unique key
- Foreign key
- Composite primary keys
- Primary key without AUTO\_INCREMENT
- ENUM type (for MySQL)

###  Health Score

40

—

FairBetter than 86% of packages

Maintenance19

Infrequent updates — may be unmaintained

Popularity43

Moderate usage in the ecosystem

Community18

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 98.4% 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 ~213 days

Recently: every ~544 days

Total

13

Last Release

1682d ago

PHP version history (3 changes)v0.10.0PHP &gt;=5.6.0

v0.11.0PHP ^7.3|^8.0

v0.12.0PHP ^7.4|^8.0

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1117087?v=4)[Tomoki Morita](/maintainers/jamband)[@jamband](https://github.com/jamband)

---

Top Contributors

[![jamband](https://avatars.githubusercontent.com/u/1117087?v=4)](https://github.com/jamband "jamband (124 commits)")[![lubobill1990](https://avatars.githubusercontent.com/u/641540?v=4)](https://github.com/lubobill1990 "lubobill1990 (2 commits)")

---

Tags

databasephpyiiyii2-extensionmigrationdatabasegeneratoryii2extensioncommand

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jamband-yii2-schemadump/health.svg)

```
[![Health](https://phpackages.com/badges/jamband-yii2-schemadump/health.svg)](https://phpackages.com/packages/jamband-yii2-schemadump)
```

###  Alternatives

[bizley/migration

Migration generator for Yii 2.

296389.5k11](/packages/bizley-migration)[hzhihua/yii2-dump

Generate the schema from an existing database

1829.6k1](/packages/hzhihua-yii2-dump)[dmstr/yii2-migrate-command

Console Migration Command with multiple paths/aliases support

33298.4k6](/packages/dmstr-yii2-migrate-command)[johnitvn/yii2-ajaxcrud

Gii CRUD template for Single Page Ajax Administration for yii2

105215.6k16](/packages/johnitvn-yii2-ajaxcrud)[dmstr/yii2-db

Database extensions

19656.2k6](/packages/dmstr-yii2-db)[mg-code/yii2-helpers

A collection of useful helper classes for Yii framework 2.0

2023.3k5](/packages/mg-code-yii2-helpers)

PHPackages © 2026

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