20230506162306_create_wechat_activity_team_table.php 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateWechatActivityTeamTable 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. $table = $this->table('wechat_activity_team', ['comment' => '微爆活动团队表', 'engine'=>'InnoDB']);
  30. $table->addColumn('activity_id', 'integer',array('comment'=>'活动id','default'=>0))
  31. ->addColumn('org_id', 'integer',array('comment'=>'团队id','default'=>0))
  32. ->addColumn('team_size', 'integer',array('comment'=>'团队人数','default'=>0))
  33. ->addColumn('pkorg_id', 'integer',array('comment'=>'pk团队id','default'=>0))
  34. ->addColumn('root_id', 'integer', array('comment'=>'积分所属企业','default'=>0))
  35. ->create();
  36. $table = $this->table('wechat_activity_course', ['comment' => '微爆活动赛程表', 'engine'=>'InnoDB']);
  37. $table->addColumn('activity_id', 'integer',array('comment'=>'活动id','default'=>0))
  38. ->addColumn('start_time', 'integer',array('limit'=>11,'comment'=>'开始时间','default'=>0))
  39. ->addColumn('end_time', 'integer',array('limit'=>11,'comment'=>'结束时间','default'=>0))
  40. ->addColumn('root_id', 'integer', array('comment'=>'积分所属企业','default'=>0))
  41. ->create();
  42. }
  43. }