PHPackages                             cheukpang/think-migration - 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. cheukpang/think-migration

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

cheukpang/think-migration
=========================

v3.0.3(5y ago)076[1 issues](https://github.com/xcorp1986/think-migration/issues)Apache-2.0PHP

Since Mar 24Pushed 5y agoCompare

[ Source](https://github.com/xcorp1986/think-migration)[ Packagist](https://packagist.org/packages/cheukpang/think-migration)[ RSS](/packages/cheukpang-think-migration/feed)WikiDiscussions 2.0 Synced 5d ago

READMEChangelogDependencies (3)Versions (25)Used By (0)

thinkphp5.1 数据库迁移工具
===================

[](#thinkphp51-数据库迁移工具)

安装
--

[](#安装)

```
composer require cheukpang/think-migration

```

修改（v2.0.4）
----------

[](#修改v204)

- Column的类型报错
- PdoAdapter.php中的getColumnTypes方法中添加了smallinteger的数组内容， 这里修改后可以过滤掉Column的类型报错
- mysql的类型不支持报错
- AdapterInterface.php中添加常量 const PHINX\_TYPE\_SMALL\_INTEGER = 'smallinteger';
- MysqlAdapter.php中修改和添加getSqlType方法中的内容

```
   case static::PHINX_TYPE_INTEGER:
       if ($limit && $limit >= static::INT_TINY) {
           $sizes = array(
               // Order matters! Size must always be tested from longest to shortest!
               'bigint'    => static::INT_BIG,
               'int'       => static::INT_REGULAR,
               'mediumint' => static::INT_MEDIUM,
               'smallint'  => static::INT_SMALL,
               'tinyint'   => static::INT_TINY,
           );
           $limits = array(
                // 修改部分开始########
               'smallint'  => 5,
                // 修改部分结束########
               'int'       => 11,
               'bigint'    => 20,
           );
           foreach ($sizes as $name => $length) {
               if ($limit >= $length) {
                   $def = array('name' => $name);
                   if (isset($limits[$name])) {
                       $def['limit'] = $limits[$name];
                   }
                   return $def;
               }
           }
       } elseif (!$limit) {
           $limit = 11;
       }
       return array('name' => 'int', 'limit' => $limit);
       break;
    // 后面是添加部分
   case static::PHINX_TYPE_SMALL_INTEGER:
       return array('name' => 'smallint', 'limit' => 5);
       break;

```

- 修复对php7.4不兼容的报错(官方包没怎么对v2怎么维护，只能fork建新包了)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 64% 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 ~93 days

Recently: every ~13 days

Total

20

Last Release

1934d ago

Major Versions

v1.1.1 → v2.0.12017-10-16

v2.0.3 → v3.0.02019-04-24

### Community

Maintainers

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

---

Top Contributors

[![yunwuxin](https://avatars.githubusercontent.com/u/2168125?v=4)](https://github.com/yunwuxin "yunwuxin (32 commits)")[![liu21st](https://avatars.githubusercontent.com/u/1111670?v=4)](https://github.com/liu21st "liu21st (9 commits)")[![shouder](https://avatars.githubusercontent.com/u/25747462?v=4)](https://github.com/shouder "shouder (5 commits)")[![joewulf](https://avatars.githubusercontent.com/u/12507872?v=4)](https://github.com/joewulf "joewulf (3 commits)")[![hugtale](https://avatars.githubusercontent.com/u/7259708?v=4)](https://github.com/hugtale "hugtale (1 commits)")

### Embed Badge

![Health badge](/badges/cheukpang-think-migration/health.svg)

```
[![Health](https://phpackages.com/badges/cheukpang-think-migration/health.svg)](https://phpackages.com/packages/cheukpang-think-migration)
```

###  Alternatives

[topthink/think-orm

the PHP Database&amp;ORM Framework

4542.0M218](/packages/topthink-think-orm)[topthink/think-migration

96460.8k121](/packages/topthink-think-migration)[topthink/think-mongo

mongodb driver for thinkphp6.0

109139.8k6](/packages/topthink-think-mongo)

PHPackages © 2026

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