-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use mediumtext for output/exception, autotrim exception
- Loading branch information
David Vandemaele
committed
Apr 13, 2022
1 parent
82c419d
commit aeed76c
Showing
2 changed files
with
26 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<?php | ||
/** | ||
* Database migration class | ||
* | ||
* @author David Vandemaele <[email protected]> | ||
* | ||
*/ | ||
|
||
namespace Skeleton\Transaction; | ||
|
||
use \Skeleton\Database\Database; | ||
|
||
class Migration_20220413_141157_Trim extends \Skeleton\Database\Migration { | ||
|
||
/** | ||
* Migrate up. | ||
*/ | ||
public function up(): void { | ||
$db = Database::get(); | ||
$db->query('UPDATE transaction_log SET exception = SUBSTRING(exception, 1, 16777215);'); | ||
$db->query('UPDATE transaction_log SET output = SUBSTRING(output, 1, 16777215);'); | ||
$db->query('ALTER TABLE `transaction_log` MODIFY `output` mediumtext, MODIFY `exception` mediumtext;'); | ||
} | ||
|
||
} |