20230214062222_create_vr_group.php 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateVrGroup 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('vr_group', ['comment'=>'vr作品'])
  30. ->addColumn('title', 'string', ['comment' => '标题','null' => true, 'length' => 50])
  31. ->addColumn('createtime', 'integer', ['comment' => '添加时间'])
  32. ->addColumn('status', 'boolean', ['comment' => '状态(0草稿,1发布,2审核通过,-1驳回)'])
  33. ->addColumn('updatetime', 'integer', ['comment' => '更新时间'])
  34. ->addColumn('emp_id', 'integer', ['comment' => '创建人', 'null' => true])
  35. ->addColumn('org_path', 'string', ['comment' => '部门路径', 'null' => true])
  36. ->addColumn('logo_path', 'string', ['comment' => 'logo路径', 'null' => true])
  37. ->addColumn('floder_id', 'integer', ['comment' => '文件夹id', 'null' => true])
  38. ->addColumn('team_floder_id', 'integer', ['comment' => '团队文件夹id', 'null' => true])
  39. ->addColumn('desc', 'string', ['comment' => '作品简介', 'null' => true])
  40. ->addColumn('size', 'integer', ['comment' => '封面大小', 'null' => true])
  41. ->addColumn('pic_path', 'string', ['comment' => '封面地址', 'null' => true])
  42. ->addColumn('view_count', 'integer', ['comment' => '场景数', 'null' => true])
  43. ->addColumn('root_id', 'integer', ['comment' => '公司id'])
  44. ->addColumn('publish_time', 'integer', ['comment' => '发布时间','null' => true])
  45. ->addColumn('mask', 'string', ['comment' => '遮罩', 'null' => true,'default'=>''])
  46. ->addColumn('cut_status', 'integer', ['comment' => '切图状态,0未开始,1制作切图中,2切图完成,3切图失败','null' => true])
  47. ->addColumn('qrcode', 'string', ['comment' => '预览二维码', 'null' => true,'default'=>''])
  48. ->addColumn('view_url', 'string', ['comment' => '预览地址', 'null' => true,'default'=>''])
  49. ->addColumn('review_time', 'timestamp',array('comment'=>'审核时间','default'=> 'CURRENT_TIMESTAMP'))
  50. ->addColumn('times', 'string', ['comment' => '放大缩小倍数', 'null' => true,'default'=>0])
  51. ->create();
  52. $table = $this->table('employee');
  53. $table->addColumn('apple_user', 'string', ['limit'=> 255, 'comment'=> '苹果唯一标识', 'default'=> ''])
  54. ->update();
  55. $this->table('app_setting', ['comment'=>'app设置表'])
  56. ->addColumn('code', 'string', ['comment' => '标识码','default'=>'', 'length' => 255])
  57. ->addColumn('root_id', 'integer', ['comment' => '店面id,0为全局配置','default'=>0])
  58. ->addColumn('type', 'string', ['comment' => '类型,string,array,json','default'=>'', 'length' => 255])
  59. ->addColumn('content', 'text', ['comment' => '内容'])
  60. ->addColumn('remark', 'string', ['comment' => '备注','default'=>'', 'length' => 255])
  61. ->addColumn('addtime', 'timestamp',array('comment'=>'审核时间','default'=> 'CURRENT_TIMESTAMP'))
  62. ->create();
  63. }
  64. }