Skip to content

Commit 69ed516

Browse files
committed
refactor(schema): drop ClickHouse PartitionType::Range sentinel
ClickHouse only uses partitionExpression — the PartitionType enum is meaningless for it. Gate the partition emission on the expression itself instead of flipping a Range sentinel just to satisfy a non-null check.
1 parent 1fec919 commit 69ed516

2 files changed

Lines changed: 1 addition & 4 deletions

File tree

src/Query/Schema/ClickHouse.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ public function compileCreate(Table $table, bool $ifNotExists = false): Statemen
212212
. ' (' . \implode(', ', $columnDefs) . ')'
213213
. ' ENGINE = ' . $this->compileEngine($engine, $table->engineArgs);
214214

215-
if ($table->partitionType !== null) {
215+
if ($table->partitionExpression !== '') {
216216
$sql .= ' PARTITION BY ' . $table->partitionExpression;
217217
}
218218

src/Query/Schema/Table/ClickHouse.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
use Utopia\Query\Schema\ClickHouse\Engine;
77
use Utopia\Query\Schema\Column;
88
use Utopia\Query\Schema\ColumnType;
9-
use Utopia\Query\Schema\PartitionType;
109
use Utopia\Query\Schema\Table;
1110

1211
class ClickHouse extends Table
@@ -310,9 +309,7 @@ public function settings(array $settings): static
310309
*/
311310
public function partitionBy(string $expression): static
312311
{
313-
$this->partitionType = PartitionType::Range;
314312
$this->partitionExpression = $expression;
315-
$this->partitionCount = null;
316313

317314
return $this;
318315
}

0 commit comments

Comments
 (0)