# think-migration **Repository Path**: magein/think-migration ## Basic Information - **Project Name**: think-migration - **Description**: No description available - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-10-26 - **Last Updated**: 2025-08-12 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Thinkphp , Migration ### 简介 依赖magein/migration创建适用于thinkphp的扩展包, magein/migration与think-migration区别在于写法,前者支持链式调用 [magein/migration](https://gitee.com/magein/php-migration) [gitee](https://gitee.com/magein/think-migration) | [composer](https://packagist.org/packages/magein/think-migration) [thinkphp官方文档](https://www.kancloud.cn/manual/thinkphp6_0/1118028) [think-migration](https://packagist.org/packages/topthink/think-migration) ### 功能 1. 数据库配置文件使用thinkphp的db 2. 支持服务类加载 ```json { "extra": { "think": { "services": [ "magein\\think\\migration\\MigrationService" ] } } } ``` ### 安装 ``` composer require magein/think-migration ``` ### 使用 #### 可选配置 在config/console.php添加一下配置 ```php [ 'command'=>[ 'migrate:new'=>MigrateCommand::class, 'mi:new'=>MigrateCommand::class, 'mi:create'=>MigrateCommand::class, 'mi:run'=>MigrateCommand::class, ] ] ``` #### 运行 ```shell # think后面的 1:2 取决于console.php你配置的 php think migate:new --help php think migate:new user php think mi:new user php think mi:create user php think mi:run user # 执行 php think migate:new user run php think migate:new run # 回滚 php think migate:new user rollback php think migate:new rollback ```