1
0

20220430100545_create_weworksingle_external_message_table.php 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateWeworksingleExternalMessageTable extends Migrator
  5. {
  6. /**
  7. * Change Method.
  8. *
  9. * Write your reversible migrations using this method.
  10. *
  11. * More information on writing migrations is available here:
  12. * http://docs.phinx.org/en/latest/migrations.html#the-abstractmigration-class
  13. *
  14. * The following commands can be used in this method and Phinx will
  15. * automatically reverse them when rolling back:
  16. *
  17. * createTable
  18. * renameTable
  19. * addColumn
  20. * renameColumn
  21. * addIndex
  22. * addForeignKey
  23. *
  24. * Remember to call "create()" or "update()" and NOT "save()" when working
  25. * with the Table class.
  26. */
  27. public function change()
  28. {
  29. $table = $this->table('weworksingle_external_message', ['comment' => '企业微信群发任务表', 'engine'=>'InnoDB']);
  30. $table->addColumn(Column::tinyInteger('send_type')->setComment('发送类型1、单2、群'))
  31. ->addColumn('root_org', 'integer', array('limit' => 10, 'comment'=>'创建组织'))
  32. ->addColumn('sendtime', 'integer', array('limit' => 10, 'comment'=>'发送时间'))
  33. ->addColumn('endtime', 'integer', array('limit' => 10,'comment'=>'发送截止时间'))
  34. ->addColumn('receive_userid', 'text', array('comment'=>'接收人员(单聊)'))
  35. ->addColumn('send_org_id', 'string', array('limit'=> 255, 'comment'=>'发送组织'))
  36. ->addColumn('customer_group', 'string', array('limit'=> 200, 'comment'=>'群发客户组'))
  37. ->addColumn('employee_id', 'text', array('comment'=>'发送员工'))
  38. ->addColumn('external_user', 'text', array('comment'=>'发送外部联系人'))
  39. ->addColumn('content', 'text', array('comment'=>'发送内容'))
  40. ->addColumn('attachments', 'text', array('comment'=>'附件json'))
  41. ->addColumn(Column::tinyInteger('status')->setComment('发送类型1、单2、群'))
  42. ->addColumn('executetime', 'integer', array('limit'=> 10, 'comment'=>'执行时间'))
  43. ->create();
  44. }
  45. }