You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// No algorithm specified → defaults to `TYPE minmax GRANULARITY 3`
2110
-
$table->index(['id']);
2111
-
});
2106
+
->index(['id'])
2107
+
->create();
2112
2108
2113
2109
// CREATE TABLE `events` (..., INDEX `idx_user_id` `user_id` TYPE bloom_filter GRANULARITY 1, ...)
2114
2110
```
2115
2111
2116
2112
The 6 algorithms are `MinMax`, `Set`, `BloomFilter`, `NgramBloomFilter`, `TokenBloomFilter`, `Inverted`. Algorithm-specific arguments are passed via `algorithmArgs` and rendered verbatim — supply them from trusted (developer-controlled) source. Other dialects ignore the ClickHouse-only `algorithm` / `algorithmArgs` / `granularity` arguments.
2117
2113
2118
-
`MinMax` and `Inverted` take no parenthesised arguments in ClickHouse DDL — passing `algorithmArgs` for them throws `ValidationException`. Skip indexes can also be added via `ALTER TABLE … ADD INDEX` by calling `index()`inside an `alter()` callback.
2114
+
`MinMax` and `Inverted` take no parenthesised arguments in ClickHouse DDL — passing `algorithmArgs` for them throws `ValidationException`. Skip indexes can also be added via `ALTER TABLE … ADD INDEX` by calling `alter()`on the builder.
2119
2115
2120
2116
**Engine SETTINGS** — emit `SETTINGS k=v` after the TTL clause:
2121
2117
2122
2118
```php
2123
-
$schema->create('events', function (Table $table) {
2124
-
$table->bigInteger('id')->primary();
2125
-
$table->settings([
2119
+
$schema->table('events')
2120
+
->bigInteger('id')->primary()
2121
+
->settings([
2126
2122
'index_granularity' => 8192,
2127
2123
'allow_nullable_key' => true, // booleans become 1/0
2128
-
]);
2129
-
});
2124
+
])
2125
+
->create();
2130
2126
2131
2127
// CREATE TABLE `events` (...) ENGINE = MergeTree() ORDER BY (`id`)
0 commit comments