12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class AddFromToExamTrain 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('exam_emp_result')
- ->addColumn('from', 'integer', ['limit'=> 11, 'comment'=>'0试卷考核,1新兵训练营考核,2历史考核' ,'default' => 0])
- ->update();
- $this->table('train_done_log')
- ->addColumn('from', 'integer', ['limit'=> 11, 'comment'=>'0试卷考核,1新兵训练营考核,2历史考核' ,'default' => 0])
- ->update();
- $this->table('camp')
- ->addColumn('root_id', 'integer', ['comment' => '企业id', 'default' => 0])
- ->addColumn('title', 'string', ['comment'=>'训练营名称', 'default' => ''])
- ->addColumn('addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP', 'comment'=>'创建时间'])
- ->addColumn('start_date', 'date', ['comment'=>'结束日期', 'null' => true])
- ->addColumn('end_date', 'date', ['comment'=>'结束日期', 'null' => true])
- ->addColumn('pattern', 'integer', ['limit'=> 11, 'comment'=>'0日期,1闯关' ,'default' => 0])
- ->addColumn('time', 'time', ['comment'=>'解锁时间', 'null' => true])
- ->addColumn('day', 'integer', ['limit'=> 11, 'comment'=>'间隔天数' ,'default' => 0])
- ->addColumn('del', 'integer', ['limit'=> 11, 'comment'=>'删除' ,'default' => 0])
- ->addColumn('content', 'text', array('comment'=>'计划内容', 'null' => true))
- ->create();
- $this->table('camp_employee')
- ->addColumn('root_id', 'integer', ['comment' => '企业id', 'default' => 0])
- ->addColumn('camp_id', 'integer', ['comment' => '训练营id', 'default' => 0])
- ->addColumn('employee_id', 'integer', ['comment' => '指派id', 'default' => 0])
- ->addColumn('now', 'integer', ['comment' => '0历史指派,1最新指派', 'default' => 0])
- ->addColumn('state', 'string', ['comment'=>'状态', 'default' => ''])
- ->addColumn('addtime', 'timestamp', ['default'=> 'CURRENT_TIMESTAMP', 'comment'=>'创建时间'])
- ->addColumn('approve', 'integer', ['comment' => '0是否提交申请/是否训练,1待审核,2通过,3不通过,4直接转正', 'default' => 0])
- ->addColumn('approve_time', 'timestamp', ['null' => true, 'comment'=>'创建时间'])
- ->addColumn('speed', 'string', ['comment'=>'进度', 'default' => ''])
- ->create();
- $this->table('camp_plan')
- ->addColumn('root_id', 'integer', ['comment' => '企业id', 'default' => 0])
- ->addColumn('camp_id', 'integer', ['comment' => '训练营id', 'default' => 0])
- ->addColumn('type', 'integer', ['comment' => '0课程,1试卷', 'default' => 0])
- ->addColumn('plan_id', 'integer', ['comment' => '计划id', 'default' => 0])
- ->addColumn('title', 'string', ['comment'=>'标题', 'default' => ''])
- ->addColumn('con_id', 'integer', ['comment' => '课程或试卷id', 'default' => 0])
- ->addColumn('del', 'integer', ['comment' => '删除', 'default' => 0])
- ->create();
- }
- }
|