123456789101112131415161718192021222324252627282930313233343536373839 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateWeworkUserTable 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()
- {
- $table = $this->table('wework_user', ['comment' => '企业授权用户表', 'engine'=>'InnoDB']);
- $table->addColumn('corpid', 'string',array('limit' => 200, 'comment'=>'所属企业ID'))
- ->addColumn('userid', 'string',array('limit' => 200, 'comment'=>'用户ID'))
- ->addColumn('deviceid', 'string',array('limit' => 200, 'comment'=>'手机设备号'))
- ->addColumn('open_userid', 'string',array('limit' => 200, 'comment'=>'同一服务商下的所有应用,该值一样(暂时无用)'))
- ->addColumn('createtime', 'timestamp', array('default'=> 'CURRENT_TIMESTAMP', 'comment'=>'创建时间'))
- ->create();
- }
- }
|