Skip to content

Commit 6e126f8

Browse files
cleanup
1 parent fca4067 commit 6e126f8

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

src/Schema/Grammars/GrammarTypes.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,7 @@ public function compileChange(BaseBlueprint $blueprint, Fluent $command, Connect
2323

2424
$changedColumn = $command->column;
2525

26-
if (filled($changedColumn['compression'])) {
27-
$queries[] = sprintf(
28-
'alter table %s alter %s set compression %s',
29-
$this->wrapTable($blueprint->getTable()),
30-
$this->wrap($changedColumn['name']),
31-
$this->wrap($changedColumn['compression']),
32-
);
33-
}
34-
26+
$compression = $changedColumn['compression'];
3527
$changedColumn->offsetUnset('compression');
3628

3729
$sql = parent::compileChange($blueprint, $command, $connection);
@@ -51,7 +43,16 @@ public function compileChange(BaseBlueprint $blueprint, Fluent $command, Connect
5143
$queries[] = $sql;
5244
}
5345

54-
return array_reverse($queries);
46+
if (filled($compression)) {
47+
$queries[] = sprintf(
48+
'alter table %s alter %s set compression %s',
49+
$this->wrapTable($blueprint->getTable()),
50+
$this->wrap($changedColumn['name']),
51+
$this->wrap($compression),
52+
);
53+
}
54+
55+
return $queries;
5556
}
5657

5758
$queries = [];

0 commit comments

Comments
 (0)