Fixed Build.log column size for MySQL (text -> longtext). Issue #26

This commit is contained in:
Dmitry Khomutov 2017-02-23 18:56:35 +07:00
parent 041ab16e71
commit 1227784335
No known key found for this signature in database
GPG key ID: 7EB36C9576F9ECB9
2 changed files with 25 additions and 3 deletions

View file

@ -9,7 +9,7 @@
namespace PHPCensor\Helper;
use PHPCensor\Model\Build;
use PHPCensor\Model\Build as BaseBuild;
/**
* The BuildInterpolator class replaces variables in a string with build-specific information.
@ -28,11 +28,11 @@ class BuildInterpolator
/**
* Sets the variables that will be used for interpolation.
*
* @param Build $build
* @param BaseBuild $build
* @param string $buildPath
* @param string $url
*/
public function setupInterpolationVars(Build $build, $buildPath, $url)
public function setupInterpolationVars(BaseBuild $build, $buildPath, $url)
{
$this->interpolation_vars = [];
$this->interpolation_vars['%PHPCI%'] = 1;

View file

@ -0,0 +1,22 @@
<?php
use Phinx\Migration\AbstractMigration;
use Phinx\Db\Adapter\MysqlAdapter;
class FixedBuildLogColumnForMysql extends AbstractMigration
{
public function up()
{
$adapter = $this->getAdapter();
if ($adapter instanceof MysqlAdapter) {
$this
->table('build')
->changeColumn('log', MysqlAdapter::PHINX_TYPE_TEXT, ['limit' => MysqlAdapter::TEXT_LONG])
->save();
}
}
public function down()
{
}
}