From 12277843357180c7f9198d7623193423ded9d75a Mon Sep 17 00:00:00 2001 From: Dmitry Khomutov Date: Thu, 23 Feb 2017 18:56:35 +0700 Subject: [PATCH] Fixed Build.log column size for MySQL (text -> longtext). Issue #26 --- src/PHPCensor/Helper/BuildInterpolator.php | 6 ++--- ...13127_fixed_build_log_column_for_mysql.php | 22 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) create mode 100644 src/PHPCensor/Migrations/20170223113127_fixed_build_log_column_for_mysql.php diff --git a/src/PHPCensor/Helper/BuildInterpolator.php b/src/PHPCensor/Helper/BuildInterpolator.php index b08aaaa9..e8102447 100644 --- a/src/PHPCensor/Helper/BuildInterpolator.php +++ b/src/PHPCensor/Helper/BuildInterpolator.php @@ -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; diff --git a/src/PHPCensor/Migrations/20170223113127_fixed_build_log_column_for_mysql.php b/src/PHPCensor/Migrations/20170223113127_fixed_build_log_column_for_mysql.php new file mode 100644 index 00000000..97db6cd0 --- /dev/null +++ b/src/PHPCensor/Migrations/20170223113127_fixed_build_log_column_for_mysql.php @@ -0,0 +1,22 @@ +getAdapter(); + if ($adapter instanceof MysqlAdapter) { + $this + ->table('build') + ->changeColumn('log', MysqlAdapter::PHINX_TYPE_TEXT, ['limit' => MysqlAdapter::TEXT_LONG]) + ->save(); + } + } + + public function down() + { + } +}