123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class WeworksingleGroupMemberTable 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('weworksingle_group_member')->setComment('群成员');
- $table->addColumn('group_id', 'integer', ['limit'=> 10, 'comment'=> '群数据表id', 'default'=> 0])
- ->addColumn('chat_id', 'string', ['limit'=> 100, 'comment'=> '群聊id', 'default'=> ''])
- ->addColumn('userid', 'string', ['limit'=> 255, 'comment'=> '用户id', 'default'=> ''])
- ->addColumn('type', 'integer', ['limit'=> 2, 'comment'=> '成员类型,1 - 企业成员、2 - 外部联系人', 'default'=> 0])
- ->addColumn('unionid', 'string', ['limit'=> 255, 'comment'=> '外部联系人在微信开放平台的唯一身份标识(微信unionid)', 'default'=> ''])
- ->addColumn('join_time', 'integer', ['limit'=> 10, 'comment'=> '入群时间', 'default'=> 0])
- ->addColumn('join_scene', 'integer', ['limit'=> 2, 'comment'=> '入群方式1 - 由群成员邀请入群(直接邀请入群)2 - 由群成员邀请入群(通过邀请链接入群)3 - 通过扫描群二维码入群', 'default'=> 0])
- ->addColumn('invitor', 'string', ['limit'=> 255, 'comment'=> '邀请者(json)', 'default'=> ''])
- ->addColumn('group_nickname', 'string', ['limit'=> 255, 'comment'=> '群昵称', 'default'=> ''])
- ->addColumn('name', 'string', ['limit'=> 255, 'comment'=> '名字。如果是微信用户,则返回其在微信中设置的名字.如果是企业微信联系人,则返回其设置对外展示的别名或实名', 'default'=> ''])
- ->addColumn('status', 'integer', ['limit'=> 2, 'comment'=> '在群状态0正常,1退群', 'default'=> 0])
- ->addColumn('quit_time', 'integer', ['limit'=> 10, 'comment'=> '退群时间', 'default'=> 0])
- ->addColumn('quit_scene', 'integer', ['limit'=> 1, 'comment'=> '退群方式', 'default'=> 0])
- ->addColumn('root_id', 'integer', ['limit'=> 10, 'comment'=> '组织id', 'default'=> 0])
- ->create();
- }
- }
|