nhzex/think-phinx

v2.1.0 2022-08-08 09:52 UTC

This package is auto-updated.

Last update: 2022-09-08 10:08:57 UTC


README

thinkphp 6.0 phinx 数据迁移
phinx: ~0.12.0

Latest Stable Version License workflows coverage

Installation

composer require nhzex/think-phinx

Warning

目前版本的phinx将导致env函数被覆盖。如果使用到该函数,请在composer加载前重新声明。(phinx#1647)

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'
];

Doc