20230425092849_create_admin_all_study_table.php 5.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateAdminAllStudyTable 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('lecturer_company', ['comment' => '总后台讲师所属企业表', 'engine'=>'InnoDB']);
  30. $table->addColumn('name', 'string',array('comment'=>'企业名称','default'=> ''))
  31. ->addColumn('addtime', 'integer',array('comment'=>'添加时间','default'=> 0))
  32. ->addColumn('root_id', 'integer',array('comment'=>'店面id','default'=> 0))
  33. ->create();
  34. $table = $this->table('lecturer', ['comment' => '总后台讲师表', 'engine'=>'InnoDB']);
  35. $table->addColumn('lecturer_company_id', 'integer',array('limit' => 11, 'comment'=>'讲师所属企业id'))
  36. ->addColumn('name', 'string',array('comment'=>'讲师名称','default'=> ''))
  37. ->addColumn('speaker_type', 'string',array('comment'=>'主讲类型','default'=> ''))
  38. ->addColumn('photo', 'string',array('comment'=>'形象照','default'=> ''))
  39. ->addColumn('poster', 'string',array('comment'=>'宣传海报','default'=> ''))
  40. ->addColumn('case', 'string',array('comment'=>'简介','default'=> ''))
  41. ->addColumn('addtime', 'integer',array('comment'=>'添加时间','default'=> 0))
  42. ->addColumn('root_id', 'integer',array('comment'=>'店面id','default'=> 0))
  43. ->addColumn('del', 'integer',array('comment'=>'删除 1删除','default'=> 0))
  44. ->create();
  45. $table = $this->table('broadcast', ['comment' => '总后台直播表', 'engine'=>'InnoDB']);
  46. $table->addColumn('lecturer_id', 'integer',array('limit' => 11, 'comment'=>'讲师id'))
  47. ->addColumn('name', 'string',array('comment'=>'直播名称','default'=> ''))
  48. ->addColumn('start_date', 'integer',array('comment'=>'直播开始时间','default'=> 0))
  49. ->addColumn('end_date', 'integer',array('comment'=>'直播结束时间','default'=> 0))
  50. ->addColumn('broadcast_type', 'integer',array('comment'=>'直播类型0普通直播,1威哥直播','default'=> 0))
  51. ->addColumn('broadcast_platform', 'integer',array('comment'=>'直播类型0boss直播,1其他直播','default'=> 0))
  52. ->addColumn('broadcast_url', 'string',array('comment'=>'直播连接','default'=> ''))
  53. ->addColumn('broadcast_cover', 'string',array('comment'=>'直播封面','default'=> ''))
  54. ->addColumn('addtime', 'integer',array('comment'=>'添加时间','default'=> 0))
  55. ->addColumn('playback_cover', 'string',array('comment'=>'回放封面','default'=> ''))
  56. ->addColumn('playback_url', 'string',array('comment'=>'回放视频','default'=> ''))
  57. ->addColumn('root_id', 'integer',array('comment'=>'店面id','default'=> 0))
  58. ->addColumn('del', 'integer',array('comment'=>'删除','default'=> 0))
  59. ->addColumn('introduce', 'text', ['comment'=>'直播介绍'])
  60. ->addColumn('position', 'string',array('comment'=>'职位','default'=> ''))
  61. ->create();
  62. $table = $this->table('activity_material', ['comment' => '总后台活动素材', 'engine'=>'InnoDB']);
  63. $table->addColumn('aid', 'integer',array('limit' => 11, 'comment'=>'活动id'))
  64. ->addColumn('url', 'string',array('comment'=>'素材地址','default'=> ''))
  65. ->addColumn('type', 'integer',array('comment'=>'素材类型0图,1视频','default'=> 0))
  66. ->addColumn('root_id', 'integer',array('comment'=>'店面id','default'=> 0))
  67. ->create();
  68. $table = $this->table('activity');
  69. $table->addColumn('introduce', 'text', ['comment'=>'操作内容'])
  70. ->update();
  71. $table = $this->table('train_class');
  72. $table->addColumn('lecturer_id', 'integer',array('limit' => 11, 'comment'=>'讲师id'))
  73. ->addColumn('introduce', 'text', ['comment'=>'课程亮点'])
  74. ->addColumn('imgs', 'text', ['comment'=>'精品课程宣传图片'])
  75. ->update();
  76. $table = $this->table('activity_collor', ['comment' => '活动收藏', 'engine'=>'InnoDB']);
  77. $table->addColumn('aid', 'integer',array('limit' => 11, 'comment'=>'活动id'))
  78. ->addColumn('employee_id', 'integer',array('comment'=>'素材类型0图,1视频','default'=> 0))
  79. ->addColumn('root_id', 'integer',array('comment'=>'店面id','default'=> 0))
  80. ->addColumn('addtime', 'integer',array('comment'=>'收藏时间','default'=> 0))
  81. ->addColumn('type', 'integer',array('comment'=>'0收藏 , 1报名','default'=> 0))
  82. ->create();
  83. }
  84. }