1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class CreateWeworksingleExternalMessageTable 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_external_message', ['comment' => '企业微信群发任务表', 'engine'=>'InnoDB']);
- $table->addColumn(Column::tinyInteger('send_type')->setComment('发送类型1、单2、群'))
- ->addColumn('root_org', 'integer', array('limit' => 10, 'comment'=>'创建组织'))
- ->addColumn('sendtime', 'integer', array('limit' => 10, 'comment'=>'发送时间'))
- ->addColumn('endtime', 'integer', array('limit' => 10,'comment'=>'发送截止时间'))
- ->addColumn('receive_userid', 'text', array('comment'=>'接收人员(单聊)'))
- ->addColumn('send_org_id', 'string', array('limit'=> 255, 'comment'=>'发送组织'))
- ->addColumn('customer_group', 'string', array('limit'=> 200, 'comment'=>'群发客户组'))
- ->addColumn('employee_id', 'text', array('comment'=>'发送员工'))
- ->addColumn('external_user', 'text', array('comment'=>'发送外部联系人'))
- ->addColumn('content', 'text', array('comment'=>'发送内容'))
- ->addColumn('attachments', 'text', array('comment'=>'附件json'))
- ->addColumn(Column::tinyInteger('status')->setComment('发送类型1、单2、群'))
- ->addColumn('executetime', 'integer', array('limit'=> 10, 'comment'=>'执行时间'))
- ->create();
- }
- }
|