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