Skip to content

Commit ad09702

Browse files
committed
fix: conflicts with upstream Laravel changes (resolves #85)
1 parent 407ca19 commit ad09702

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/Schema/Grammars/GrammarTypes.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,13 @@ public function compileChange(BaseBlueprint $blueprint, Fluent $command, Connect
3232
Arr::except($changedColumn->toArray(), ['compression']),
3333
);
3434

35-
foreach (Arr::wrap(parent::compileChange($blueprintColumn, $command, $connection)) as $sql) {
35+
// Remove Compression modifier because Laravel 11 won't work correctly with it (migrator builts incorrectly SQL).
36+
$_modifiers = $this->modifiers;
37+
$this->modifiers = array_filter($this->modifiers, fn ($str) => !\in_array($str, ['Compression']));
38+
$changes = Arr::wrap(parent::compileChange($blueprintColumn, $command, $connection));
39+
$this->modifiers = $_modifiers;
40+
41+
foreach ($changes as $sql) {
3642
$regex = Regex::match('/^ALTER table (?P<table>.*?) alter (column )?(?P<column>.*?) type (?P<type>\w+)(?P<modifiers>,.*)?/i', $sql);
3743

3844
if (filled($changedColumn['using']) && $regex->hasMatch()) {

0 commit comments

Comments
 (0)