nhzex/think-phinx
Think-Phinx
为 ThinkPHP 8 提供 Phinx 数据迁移和 seed 命令。
安装
5.0 尚未发布稳定 tag;试用开发分支时,桥接库会自动解析为稳定版 ^4.0:
composer require nhzex/think-phinx:5.0.x-dev
需要 64 位 PHP 8.1+、Composer 2.1+。Symfony 7 需要 PHP 8.2+。升级前备份数据库并验证迁移与回滚,详见 5.0 升级说明。
使用
php think migrate:create CreateUsers
php think migrate:run
php think migrate:status
php think migrate:rollback
php think seed:create UserSeeder
php think seed:run
另有 migrate:breakpoint 管理断点、migrate:test 检查配置;各命令选项可通过 php think <命令> --help 查看。若升级后命令未出现,运行 php think service:discover。
配置
在 config/phinx.php 中配置路径和迁移记录表,确保指定目录存在且可读:
<?php
return [
'paths' => [
'migrations' => [
'DbMigrations' => 'database/migrations',
],
'seeds' => [
'DbSeeds' => 'database/seeds'
]
],
'environments' => [
'default_migration_table' => '_phinxlog',
],
'version_order' => 'creation'
];
文档
Related Packages
chrishalbert/laravel-nomadic
A suite of tools to enhance robustness of laravel's migrations.
27,991
31
Version History
| Version | Released | PHP | License |
|---|---|---|---|
| v5.0.0 | >=8.1 | MIT | |
| v4.1.0 | ^7.4| | MIT | |
| v4.0.4 | ^7.4| | MIT | |
| v4.0.3 | ^7.4| | MIT | |
| v4.0.2 | ^7.4| | MIT | |
| v4.0.1 | ^7.4| | MIT | |
| v4.0.0 | ^7.4| | MIT | |
| v3.0.0 | ^7.4| | MIT | |
| v2.1.0 | ^7.2| | MIT | |
| v2.0.1 | ^7.2| | Apache-2.0 | |
| v2.0.0 | ^7.2| | Apache-2.0 | |
| v1.2.0 | ^7.2| | Apache-2.0 | |
| v1.1.7 | ^7.2| | Apache-2.0 | |
| v1.1.6 | >=7.2 | Apache-2.0 | |
| v1.1.5 | >=7.2 | Apache-2.0 | |
| v1.1.4 | >=7.2 | Apache-2.0 | |
| v1.1.3 | >=7.2 | Apache-2.0 | |
| v1.1.2 | >=7.2 | Apache-2.0 | |
| v1.1.1 | >=7.2 | Apache-2.0 | |
| v1.1.0 | >=7.2 | Apache-2.0 | |
| v1.0.3 | >=7.1 | Apache-2.0 | |
| v1.0.2 | >=7.1 | Apache-2.0 | |
| v1.0.1 | >=7.1 | Apache-2.0 | |
| v1.0.0 | >=7.1 | Apache-2.0 |
Pre-releases (3)
| Version | Released | PHP | License |
|---|---|---|---|
| v4.1.0-RC3 | ^7.4| | MIT | |
| v4.1.0-RC2 | ^7.4| | MIT | |
| v4.1.0-RC1 | ^7.4| | MIT |