Skip to content

Commit fa47121

Browse files
committed
Rename function and constant
1 parent d0415fb commit fa47121

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/lib/migrations/MigrationRecordBuilder.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ final class MigrationRecordBuilder
4848

4949
public const ADD_COMMENT_ON_COLUMN = MigrationRecordBuilder::INDENT . "\$this->addCommentOnColumn('%s', '%s', '%s');";
5050

51-
public const DROP_COMMENT_ON_COLUMN = MigrationRecordBuilder::INDENT . "\$this->dropCommentFromColumn('%s', '%s');";
51+
public const DROP_COMMENT_FROM_COLUMN = MigrationRecordBuilder::INDENT . "\$this->dropCommentFromColumn('%s', '%s');";
5252

5353
/**
5454
* @var \yii\db\Schema
@@ -350,13 +350,13 @@ public static function makeString(array $codeColumns): string
350350
return $codeColumns;
351351
}
352352

353-
public function addCommentOnColumn($table, string $column, string $comment)
353+
public function addCommentOnColumn($table, string $column, string $comment): string
354354
{
355355
return sprintf(self::ADD_COMMENT_ON_COLUMN, $table, $column, $comment);
356356
}
357357

358-
public function dropCommentOnColumn($table, string $column)
358+
public function dropCommentFromColumn($table, string $column): string
359359
{
360-
return sprintf(self::DROP_COMMENT_ON_COLUMN, $table, $column);
360+
return sprintf(self::DROP_COMMENT_FROM_COLUMN, $table, $column);
361361
}
362362
}

src/lib/migrations/PostgresMigrationBuilder.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ protected function buildColumnChanges(ColumnSchema $current, ColumnSchema $desir
9494
if (in_array('comment', $changed, true)) { // TODO
9595
if ($desired->comment) {
9696
$this->migration->addUpCode($this->recordBuilder->addCommentOnColumn($tableName, $desired->name, $desired->comment));
97-
$this->migration->addDownCode($this->recordBuilder->dropCommentOnColumn($tableName, $desired->name));
97+
$this->migration->addDownCode($this->recordBuilder->dropCommentFromColumn($tableName, $desired->name));
9898
} else {
99-
$this->migration->addUpCode($this->recordBuilder->dropCommentOnColumn($tableName, $desired->name));
99+
$this->migration->addUpCode($this->recordBuilder->dropCommentFromColumn($tableName, $desired->name));
100100
$this->migration->addDownCode($this->recordBuilder->addCommentOnColumn($tableName, $desired->name, $current->comment));
101101
}
102102
}

0 commit comments

Comments
 (0)