20220218035430_add_company_boss_open.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class AddCompanyBossOpen extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $this->table('company_boss_open', ['comment' => '开通boss直播的公司表'])
  30. ->addColumn('company_name', 'string', ['comment'=>'公司名' ,'null' => true])
  31. ->addColumn('company_id', 'integer', ['comment'=>'企业在company表中的id' ,'null' => true])
  32. ->addColumn('root_id', 'integer', ['comment' => '企业id','null' => true])
  33. ->addColumn('unionid', 'string', ['comment'=>'同步到其他系统的,本系统生成的,统一识别id', 'null' => true])
  34. ->addColumn('username', 'string', ['comment'=>'公司全拼 作为boss的用户名' ,'null' => true])
  35. ->addColumn('way', 'string', ['comment'=>'payed or free', 'default' => 'free'])
  36. ->addColumn('start_at', 'timestamp', ['comment'=>'开始时间', 'default' => 'CURRENT_TIMESTAMP'])
  37. ->addColumn('end_at', 'timestamp', ['comment'=>'结束时间', 'null' => true])
  38. ->addColumn('remark', 'string', ['comment'=>'备注', 'null' => true])
  39. ->addColumn('addtime', 'timestamp', ['comment'=>'添加时间', 'default' => 'CURRENT_TIMESTAMP'])
  40. ->create();
  41. }
  42. }