123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class AddCompanyBossOpen 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()
- {
- $this->table('company_boss_open', ['comment' => '开通boss直播的公司表'])
- ->addColumn('company_name', 'string', ['comment'=>'公司名' ,'null' => true])
- ->addColumn('company_id', 'integer', ['comment'=>'企业在company表中的id' ,'null' => true])
- ->addColumn('root_id', 'integer', ['comment' => '企业id','null' => true])
- ->addColumn('unionid', 'string', ['comment'=>'同步到其他系统的,本系统生成的,统一识别id', 'null' => true])
- ->addColumn('username', 'string', ['comment'=>'公司全拼 作为boss的用户名' ,'null' => true])
- ->addColumn('way', 'string', ['comment'=>'payed or free', 'default' => 'free'])
- ->addColumn('start_at', 'timestamp', ['comment'=>'开始时间', 'default' => 'CURRENT_TIMESTAMP'])
- ->addColumn('end_at', 'timestamp', ['comment'=>'结束时间', 'null' => true])
- ->addColumn('remark', 'string', ['comment'=>'备注', 'null' => true])
- ->addColumn('addtime', 'timestamp', ['comment'=>'添加时间', 'default' => 'CURRENT_TIMESTAMP'])
- ->create();
- }
- }
|