wjcms/tp-phinx
最新稳定版本:1.0.1
Composer 安装命令:
composer require wjcms/tp-phinx
包简介
Phinx integration for thinkphp
README 文档
README
thinkphp 6.0, 8.0 phinx 数据迁移
Installation
composer require nhzex/think-phinx
重大变更
自 4.0 起采用捆绑方式打包 phinx,不再污染全局环境,并内置 cakephp 依赖项,解决全局函数被污染问题!
目前版本的phinx将导致env函数被覆盖。如果使用到该函数,请在composer加载前重新声明。(phinx#1647)
| 版本 | phinx | 状态 |
|---|---|---|
| v4.0.* | 0.13.4 | 已发布 |
| v4.1.* | 0.14.0 | RC |
Use
migrate
migrate:breakpoint Manage breakpoints
migrate:create Create a new migration
migrate:rollback Rollback the last or to a specific migration
migrate:run Migrate the database
migrate:status Show migration status
migrate:test Verify the configuration file
seed
seed:create Create a new database seeder
seed:run Run database seeders
Config
请确保配置文件中指定的目录存在且可读
<?php return [ 'paths' => [ 'migrations' => [ 'DbMigrations' => 'database/migrations', ], 'seeds' => [ 'DbSeeds' => 'database/seeds' ] ], 'environments' => [ 'default_migration_table' => '_phinxlog', ], 'version_order' => 'creation' ];
注意事项
- 如果升级到
4.x后执行命令行提示不存在请手动执行./think service:discover以重新发现服务。
Doc
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-12-02