Commit 8a7208d1 authored by Ben Davies's avatar Ben Davies

refactor out getting old column comment

parent 77020231
......@@ -580,11 +580,8 @@ SQL
}
}
$oldComment = null;
$newComment = $this->getColumnComment($column);
if (null !== $columnDiff->fromColumn) {
$oldComment = $this->getColumnComment($columnDiff->fromColumn);
}
$oldComment = $this->getOldColumnComment($columnDiff);
if ($columnDiff->hasChanged('comment') || ($columnDiff->fromColumn !== null && $oldComment !== $newComment)) {
$commentsSQL[] = $this->getCommentOnColumnSQL(
......@@ -1254,4 +1251,9 @@ SQL
{
return $type instanceof IntegerType || $type instanceof BigIntType;
}
private function getOldColumnComment(ColumnDiff $columnDiff) : ?string
{
return $columnDiff->fromColumn ? $this->getColumnComment($columnDiff->fromColumn) : null;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment