PHP code example of ke / thinkphp-migration

1. Go to this page and download the library: Download ke/thinkphp-migration library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ke / thinkphp-migration example snippets



// /config/migration.php
return [
    'environments'=>[
        'default_migration_table'=>'phinxlog',
        'default_database'=>'default',
        'default'=>[
            'adapter'=>'mysql',
            'host'=>'127.0.0.1',
            'name'=>'',
            'user'=>'',
            'pass'=>'',
            'table_prefix'=>'',
            'port'=>3306,
            'charset'=>'utf8',
            'collation'=>'utf8mb4_unicode_ci'
        ]
    ]
];

php think migrate:breakpoint --e development

php think migrate:breakpoint --e development --r

php think migrate:create MyNewMigration

php think migrate:rollback --e development

php think migrate:rollback --e development --d 2012
php think migrate:rollback --e development --d 201201
php think migrate:rollback --e development --d 20120103
php think migrate:rollback --e development --d 2012010312
php think migrate:rollback --e development --d 201201031205
php think migrate:rollback ---e development --d 20120103120530

php think seed:create UserSeeder

php think seed:run