PHPackages                             adata-team/laravel-clickhouse-migrations - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. adata-team/laravel-clickhouse-migrations

ActiveLibrary[Database &amp; ORM](/categories/database)

adata-team/laravel-clickhouse-migrations
========================================

Clickhouse migrations for Laravel

v1.0.7(1y ago)01.2k↓50%MITPHPPHP ^8.0.0

Since May 13Pushed 1y agoCompare

[ Source](https://github.com/adata-team/laravel-clickhouse-migrations)[ Packagist](https://packagist.org/packages/adata-team/laravel-clickhouse-migrations)[ Docs](https://github.com/adata-team/laravel-clickhouse-migrations)[ RSS](/packages/adata-team-laravel-clickhouse-migrations/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (8)Dependencies (6)Versions (10)Used By (0)

Laravel Clickhouse Migrations
=============================

[](#laravel-clickhouse-migrations)

Installation
------------

[](#installation)

Install this package via [Composer](https://getcomposer.org/).

```
composer require adata-team/laravel-clickhouse-migrations
```

Publish Clickhouse configs:

```
php artisan vendor:publish --provider='Adata\ClickhouseMigrations\Providers\MigrationProvider'
```

Basic Usage
-----------

[](#basic-usage)

Create a new migration file:

```
php artisan make:clickhouse-migration {name}
```

Up migrations:

```
php artisan clickhouse-migrate
```

Down last migration:

```
php artisan clickhouse-migration:rollback
```

Advanced Usage
--------------

[](#advanced-usage)

### New Migration

[](#new-migration)

To create a new migration, use this command:

```
php artisan make:clickhouse-migration {name}
```

For example:

```
php artisan make:clickhouse-migration create_users_table
```

The new file will be located at the path specified in the configs: **clickhouse.path**

#### Table

[](#table)

You can use a more prepared stub from the library that contains a template for quickly adding a new table by adding the **--table** option:

```
php artisan make:clickhouse-migration create_users_table --table=users
```

#### Dictionary

[](#dictionary)

You can use a more prepared stub from the library that contains a template for quickly adding a new table by adding the **--table** option:

```
php artisan make:clickhouse-migration create_users_dictionary --dictionary=users
```

#### Path

[](#path)

You can override the path to the migrations folder by passing the **--path** option:

```
php artisan make:clickhouse-migration create_users_table --path=database/new-migrations-folder
```

If you want to use an absolute path to the file, add one more option - **--realpath** to the existing option:

```
php artisan make:clickhouse-migration create_users_table --path=/path/to/migrations --realpath
```

#### Stub

[](#stub)

You can use your (override) prepared stub when creating a new file, list: **clickhouse.stubs**:

For example:

```
php artisan make:clickhouse-migration create_users_table --stub=default
```

Also you can add **Handlers**, with them, you can customize over one stub every time you create a file:

```
php artisan make:clickhouse-migration create_users_table --stub=myStub --stub.handler='App\Clickhouse\MyHandler'
```

> The class must implement the `Adata\ClickhouseMigrations\Contracts\MigrationStubHandlerContract` interface

You can pass your `$parameters`, for example:

```
php artisan make:clickhouse-migration create_users_table --stub.handler='App\Clickhouse\MyHandler' --stub.param=key:value --stub.param=table:products
```

You can also register a global handler that will apply to all generated stub files: `clickhouse.handlers.global`

### Up Migrations

[](#up-migrations)

[Path option with Realpath](#path)

#### Force

[](#force)

To remove the interactive question during production migrations, you can use **--force** option:

```
php artisan clickhouse-migrate --force
```

#### Output

[](#output)

To output migrations to be applied use **--output** option:

```
php artisan clickhouse-migrate --output
```

Before applying the shown migrations - will display an interactive question, to remove it, you can add another **--force** option to this option:

```
php artisan clickhouse-migrate --output --force
```

#### Step

[](#step)

You can specify how many files need to be applied:

```
php artisan clickhouse-migrate --step=1
```

> Value `0` - all files

### Down Migrations

[](#down-migrations)

Has the same properties as in [Up Migrations](#up-migrations).

### Other

[](#other)

You can use a singleton object [smi2/phpClickHouse](https://github.com/smi2/phpClickHouse#start) to query ClickHouse (used in migrations):

```
app('clickhouse')->select(/* Query */);
app('clickhouse')->write(/* Query */);
```

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance39

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 50% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~30 days

Recently: every ~53 days

Total

8

Last Release

516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/20e7bc71d862e6b58f136f3df8d7c137d87ca2406723bf6fbe903681de0bf804?d=identicon)[nbabich](/maintainers/nbabich)

---

Top Contributors

[![nbabich-dev](https://avatars.githubusercontent.com/u/26186235?v=4)](https://github.com/nbabich-dev "nbabich-dev (1 commits)")[![YernurShamshadin](https://avatars.githubusercontent.com/u/77783095?v=4)](https://github.com/YernurShamshadin "YernurShamshadin (1 commits)")

---

Tags

laravelpackagelibrarymigrationsclickhouse

### Embed Badge

![Health badge](/badges/adata-team-laravel-clickhouse-migrations/health.svg)

```
[![Health](https://phpackages.com/badges/adata-team-laravel-clickhouse-migrations/health.svg)](https://phpackages.com/packages/adata-team-laravel-clickhouse-migrations)
```

###  Alternatives

[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[glushkovds/phpclickhouse-laravel

Adapter of the most popular library https://github.com/smi2/phpClickHouse to Laravel

2031.2M2](/packages/glushkovds-phpclickhouse-laravel)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
