1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- use think\migration\Migrator;
- use think\migration\db\Column;
- class UpdateWeworksingleExternalMessageTable 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');
- $table->drop();
- $table->addColumn('root_id', 'integer', ['limit'=> 10, 'comment'=> '组织id', 'default'=> 0])
- ->addColumn('send_employee_id', 'text', ['comment'=> '发送员工', 'null'=> true])
- ->addColumn('attachments', 'text', ['comment'=> '表单附件json', 'null'=> true])
- ->addColumn('attachments_content', 'text', ['comment'=> '转发附件json', 'null'=> true])
- ->addColumn('addtime', 'timestamp', ['comment'=> '发送时间', 'default'=> 'CURRENT_TIMESTAMP'])
- ->addColumn('repeat', 'integer', ['limit'=> 1, 'comment'=> '是否去重,0否1是', 'default'=> 0])
- ->addColumn('condition', 'text', ['comment'=> '筛选条件json', 'null'=> true])
- ->addColumn('content', 'text', ['comment'=> '发送文本内容(最多4000字节)', 'null'=> true])
- ->addColumn('employee_id', 'integer', ['limit'=> 10, 'comment'=> '创建人', 'default'=> 0])
- ->addColumn('user_list', 'text', ['comment'=> '发送用户及接收用户', 'null'=> true])
- ->addColumn('external_count', 'integer', ['limit'=> 10, 'comment'=> '外部联系人数量', 'default'=> 0])
- ->addColumn('external_send', 'text', ['comment'=> '已发送外部联系人', 'null'=> true])
- ->create();
- }
- }
|