PHP code example of overherz / clickhouse-migrations

1. Go to this page and download the library: Download overherz/clickhouse-migrations library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

overherz / clickhouse-migrations example snippets


...
'clickhouse' => [
    'host' => env('CLICKHOUSE_HOST', 'localhost'),
    'port' => env('CLICKHOUSE_PORT', 8123),
    'username' => env('CLICKHOUSE_USER', 'default'),
    'password' => env('CLICKHOUSE_PASSWORD', ''),
    'options' => [
        'database' => env('CLICKHOUSE_DATABASE', 'default'),
        'timeout' => 1,
        'connectTimeOut' => 2,
    ],
],
'clickhouse-migrations' => [
    'dir' => env('CLICKHOUSE_MIGRATION_DIR', '/database/clickhouse-migrations/'),
    'table' => env('CLICKHOUSE_MIGRATION_TABLE_NAME', 'migrations'),
],
    ...

'providers' => [
    ...
    \Serkarn\ClickhouseMigrations\ClickhouseProvider::class,
    ...
],
bash
php artisan clickhouse:migration:create {name}
bash
php artisan clickhouse:migrate

php artisan clickhouse:migrate --down