Skip to content

Commit 9f7a6b5

Browse files
committed
Fixed a MySQL error that could occur with a large webhook response body
1 parent dfbe649 commit 9f7a6b5

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Release Notes for Webhooks for Craft CMS
22

3+
## Unreleased
4+
5+
### Fixed
6+
- Fixed a MySQL error that could occur with a large webhook response body.
7+
38
## 2.3.2 - 2020-06-27
49

510
### Fixed

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class Plugin extends \craft\base\Plugin
8080
/**
8181
* @inheritdoc
8282
*/
83-
public $schemaVersion = '2.3.0';
83+
public $schemaVersion = '2.3.1';
8484

8585
/**
8686
* @var SendRequestJob[] The request jobs that should be queued up at the end of the web request.

src/migrations/Install.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public function safeUp()
6161
'requestBody' => $this->mediumText(),
6262
'responseStatus' => $this->smallInteger(),
6363
'responseHeaders' => $this->text(),
64-
'responseBody' => $this->text(),
64+
'responseBody' => $this->mediumText(),
6565
'responseTime' => $this->integer(),
6666
'dateCreated' => $this->dateTime()->notNull(),
6767
'dateRequested' => $this->dateTime(),
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?php
2+
3+
namespace craft\webhooks\migrations;
4+
5+
use craft\db\Migration;
6+
7+
/**
8+
* m210401_212615_response_body_mediumtext migration.
9+
*/
10+
class m210401_212615_response_body_mediumtext extends Migration
11+
{
12+
/**
13+
* @inheritdoc
14+
*/
15+
public function safeUp()
16+
{
17+
$this->alterColumn('{{%webhookrequests}}', 'responseBody', $this->mediumText());
18+
}
19+
20+
/**
21+
* @inheritdoc
22+
*/
23+
public function safeDown()
24+
{
25+
echo "m210401_212615_response_body_mediumtext cannot be reverted.\n";
26+
return false;
27+
}
28+
}

0 commit comments

Comments
 (0)