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