20220416071221_create_weworksingle_company_setting_table.php 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. use think\migration\Migrator;
  3. use think\migration\db\Column;
  4. class CreateWeworksingleCompanySettingTable 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_company_setting', ['comment' => '单企业应用配置', 'engine'=>'InnoDB']);
  30. $table->addColumn('company_id', 'integer', array('limit' => 10, 'comment'=>'企业ID'))
  31. ->addColumn('corp_id', 'string', array('limit' => 100, 'comment'=>'企业微信ID'))
  32. ->addColumn('ticket', 'string', array('limit' => 50, 'comment'=>'票据'))
  33. ->addColumn('agentid', 'string', array('limit' => 30,'comment'=>'应用ID'))
  34. ->addColumn('agent_secret', 'string', array('limit' => 200, 'comment'=>'应用秘钥'))
  35. ->addColumn('receive_token', 'string', array('limit'=> 200, 'comment'=>'接收消息token'))
  36. ->addColumn('receive_aes_key', 'string', array('limit'=> 200, 'comment'=>'接收消息EncodingAESKey'))
  37. ->addColumn('contact_secret', 'string', array('limit'=> 200, 'comment'=>'通讯录secret'))
  38. ->addColumn('contact_token', 'string', array('limit'=> 200, 'comment'=>'通讯录token'))
  39. ->addColumn('contact_aes_key', 'string', array('limit'=> 200, 'comment'=>'通讯录EncodingAESKey'))
  40. ->addColumn('customer_secret', 'string', array('limit'=> 200, 'comment'=>'外部联系人secret'))
  41. ->addColumn('customer_token', 'string', array('limit'=> 200, 'comment'=>'外部联系人token'))
  42. ->addColumn('customer_aes_key', 'string', array('limit'=> 200, 'comment'=>'外部联系人EncodingAESKey'))
  43. ->create();
  44. }
  45. }