39 lines
1.5 KiB
PHP
39 lines
1.5 KiB
PHP
<?php
|
|
use think\migration\Migrator;
|
|
|
|
class PlatformAddField extends Migrator
|
|
{
|
|
/**
|
|
* Change Method.
|
|
*
|
|
* Write your reversible migrations using this method.
|
|
*
|
|
* More information on writing migrations is available here:
|
|
* http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
|
|
*
|
|
* The following commands can be used in this method and Phinx will
|
|
* automatically reverse them when rolling back:
|
|
*
|
|
* createTable
|
|
* renameTable
|
|
* addColumn
|
|
* renameColumn
|
|
* addIndex
|
|
* addForeignKey
|
|
*
|
|
* Remember to call "create()" or "update()" and NOT "save()" when working
|
|
* with the Table class.
|
|
*/
|
|
public function change()
|
|
{
|
|
$table = $this->table('platform');
|
|
$table
|
|
->addColumn('vi_color1','string',['limit'=>10,'after'=>'name','default'=>'','null'=>false,'comment'=>'品牌vi色1'])
|
|
->addColumn('vi_color2','string',['limit'=>10,'after'=>'vi_color1','default'=>'','null'=>false,'comment'=>'品牌vi色2'])
|
|
->addColumn('vi_color3','string',['limit'=>10,'after'=>'vi_color2','default'=>'','null'=>false,'comment'=>'品牌vi色3'])
|
|
->addColumn('language_id','integer',['limit'=>10,'after'=>'vi_color3','signed'=>false,'default'=>0,'null'=>false,'comment'=>'语言ID'])
|
|
->addColumn('currency_id','integer',['limit'=>10,'after'=>'language_id','signed'=>false,'default'=>0,'null'=>false,'comment'=>'币种ID'])
|
|
->update();
|
|
}
|
|
}
|