PHPackages                             ke/thinkphp-beautiful-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. ke/thinkphp-beautiful-migrate

ActiveLibrary

ke/thinkphp-beautiful-migrate
=============================

一个易使用、漂亮的数据库迁移代码构建器

1.0.2(3y ago)633MITPHP

Since Mar 5Pushed 3y ago1 watchersCompare

[ Source](https://github.com/wdaglb/beautiful-migrate)[ Packagist](https://packagist.org/packages/ke/thinkphp-beautiful-migrate)[ RSS](/packages/ke-thinkphp-beautiful-migrate/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

thinkphp-beautiful-migrate
--------------------------

[](#thinkphp-beautiful-migrate)

一个易使用、漂亮的数据库迁移代码构建器

- 支持Thinkphp6.0.x

### 安装

[](#安装)

```
composer require ke/thinkphp-beautiful-migrate

```

### 使用

[](#使用)

```
// 创建表
Schema::create($this->getAdapter(), '表名', function (Blueprint $blueprint) {
    // 迁移代码
});

// 修改表
Schema::table($this->getAdapter(), '表名', function (Blueprint $blueprint) {
    // 迁移代码
});

```

### 可用的字段定义方法

[](#可用的字段定义方法)

命令描述$blueprint-&gt;id();定义一个bigint 并命名为id的主键$blueprint-&gt;bigInteger('votes');相当于 BIGINT$blueprint-&gt;binary('data');相当于 BLOB$blueprint-&gt;boolean('confirmed');相当于 BOOLEAN$blueprint-&gt;char('name', 100);相当于带有长度的 CHAR$blueprint-&gt;date('created\_at');相当于 DATE$blueprint-&gt;dateTime('created\_at');相当于 DATETIME$blueprint-&gt;decimal('amount', 8, 2);相当于带有精度与基数 DECIMAL$blueprint-&gt;enum('level', \['easy', 'hard'\]);相当于 ENUM$blueprint-&gt;geometry('positions');相当于 GEOMETRY$blueprint-&gt;integer('votes');相当于 INTEGER$blueprint-&gt;json('options');相当于 JSON$blueprint-&gt;jsonb('options');相当于 JSONB$blueprint-&gt;lineString('positions');相当于 LINESTRING$blueprint-&gt;longText('description');相当于 LONGTEXT$blueprint-&gt;mediumInteger('votes');相当于 MEDIUMINT$blueprint-&gt;mediumText('description');相当于 MEDIUMTEXT$blueprint-&gt;point('position');相当于 POINT$blueprint-&gt;polygon('positions');相当于 POLYGON$blueprint-&gt;smallInteger('votes');相当于 SMALLINT$blueprint-&gt;softDeletes();相当于为软删除添加一个可空的 delete\_time 字段$blueprint-&gt;string('name', 100);相当于带长度的 VARCHAR$blueprint-&gt;text('description');相当于 TEXT$blueprint-&gt;time('sunrise');相当于 TIME$blueprint-&gt;timestamp('added\_on');相当于 TIMESTAMP$blueprint-&gt;timestamps();相当于可空的 create\_time 和 update\_time TIMESTAMP$blueprint-&gt;tinyInteger('votes');相当于 TINYINT$blueprint-&gt;unsignedBigInteger('votes');相当于 Unsigned BIGINT$blueprint-&gt;unsignedDecimal('amount', 8, 2);相当于带有精度和基数的 UNSIGNED DECIMAL$blueprint-&gt;unsignedInteger('votes');相当于 Unsigned INT$blueprint-&gt;unsignedMediumInteger('votes');相当于 Unsigned MEDIUMINT$blueprint-&gt;unsignedSmallInteger('votes');相当于 Unsigned SMALLINT$blueprint-&gt;unsignedTinyInteger('votes');相当于 Unsigned TINYINT$blueprint-&gt;uuid('id');相当于 UUID$blueprint-&gt;year('birth\_year');相当于 YEAR[查看使用示例](./example/20210304140550_admin.php)

QQ交流群：942503490

by King east

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity55

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 ~335 days

Total

3

Last Release

1229d ago

### Community

Maintainers

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

---

Top Contributors

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

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ke-thinkphp-beautiful-migrate/health.svg)

```
[![Health](https://phpackages.com/badges/ke-thinkphp-beautiful-migrate/health.svg)](https://phpackages.com/packages/ke-thinkphp-beautiful-migrate)
```

###  Alternatives

[zoujingli/think-library

Library for ThinkAdmin

8569.8k18](/packages/zoujingli-think-library)[jaguarjack/catchadmin

The CatchAdmin Background management

8962.6k](/packages/jaguarjack-catchadmin)[casbin/think-authz

An authorization library that supports access control models like ACL, RBAC, ABAC for ThinkPHP.

27918.5k6](/packages/casbin-think-authz)

PHPackages © 2026

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