Skip to content

Commit

Permalink
Merge pull request #79 from pimcore/rename-column-to-change-column
Browse files Browse the repository at this point in the history
[Bug: Refactor migration to `CHANGE COLUMN` instead of `RENAME`
  • Loading branch information
mcop1 authored Jun 21, 2023
2 parents 3c347ab + 5e50164 commit fa58430
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Migrations/PimcoreX/Version20230124103907.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function up(Schema $schema): void

if ($table->hasColumn('o_classId')) {
$this->addSql(sprintf(
'ALTER TABLE `%s` RENAME COLUMN `%s` TO `%s`',
'ALTER TABLE `%s` CHANGE COLUMN `%s` `%s` varchar(50) NULL',
$table->getName(),
'o_classId',
'classId'
Expand All @@ -51,7 +51,7 @@ public function down(Schema $schema): void

if ($table->hasColumn('classId')) {
$this->addSql(sprintf(
'ALTER TABLE `%s` RENAME COLUMN `%s` TO `%s`',
'ALTER TABLE `%s` CHANGE COLUMN `%s` `%s` varchar(50) NULL',
$table->getName(),
'classId',
'o_classId'
Expand Down

0 comments on commit fa58430

Please sign in to comment.