dmamontov/clickhouse-migrations-bundle
This bundle added the migrations system for clickhouse type Databases into Symfony applications. Database migrations help you version the changes in your database schema and apply them in a predictable way on every server running the application.
composer require dmamontov/clickhouse-migrations-bundle
For use this bundle you need set clickhouse Client as Symfony service. As example:
#config/services.yaml
services:
ClickHouseDB\Client:
arguments:
$connectParams:
host: 'http://localhost'
port: 8123
username: 'username'
password: ''
sslCA: 'path_to_ssl_cert'
$settings:
database: 'default'
More details about ClickHouseDB\Client settings.
If you need set migrations, set clickhouse migrations configuration. But this is not necessary, these settings are set by default:
#config/packages/clickhouse_migrations.yaml
clickhouse_migrations:
table_name: 'migrations_versions'
migrations_path: '%kernel.project_dir%/clickhouse_migrations'
migrations_namespace: 'ClickhouseMigrations'
Generate new migration class:
bin/console clickhouse:migrations:generate
Execute all unapplied migrations up:
bin/console clickhouse:migrations:migrate
One last migration down:
bin/console clickhouse:migrations:migrate down
How can I help you explore Laravel packages today?