nhzex / think-phinx
Phinx integration for thinkphp
Installs: 2 775
Dependents: 0
Suggesters: 0
Security: 0
Stars: 23
Watchers: 2
Forks: 1
Open Issues: 1
Requires
- php: ^7.4|^8.0
- composer-runtime-api: ^2.1
- psr/container: ^1.0 || ^2.0
- robmorgan/phinx: ~0.13
- symfony/config: ^5.4|^6.0
- symfony/console: ^5.4|^6.0
- topthink/framework: ^6.0|^6.1|^8.0.1
- topthink/think-orm: ^2.0.30|^3.0
- zxin/phinx-schema: ^1.0.2
- zxin/think-symfony-bridge: ^3.0
Requires (Dev)
Replaces
- cakephp/database: 4.4.17
- robmorgan/phinx: 0.13.4
README
thinkphp 6.0, 8.0 phinx 数据迁移
内置 phinx: 0.13.4
Installation
composer require nhzex/think-phinx
Warning
目前版本的phinx
将导致env
函数被覆盖。如果使用到该函数,请在composer
加载前重新声明。(phinx#1647)
自 4.0 起 phinx 不再污染全局环境
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' ];