Add ClickHouse structure SQL and rake tasks

What does this MR do and why?

  • Adds tasks for loading schemas, as well as dumping schemas during migration and rollback
  • Adds documentation on how to load schema
  • Updates test environment to load from schema, not run migrations.

References

Screenshots or screen recordings

Before After

How to set up and validate locally

  • Run ClickHouse migrations, and assert that a file db/click_house/main.sql has been created with the schema dump.
  • Run tests that are annotated with the RSpec :click_house type. These tests should all run as before, although the tables are generated using the schema dump and not the migrations.
  • DROP all tables in the development database (if you can), and run bundle exec rake gitlab:clickhouse:load_schema:main to repopulate the schema.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Max Woolf

Merge request reports

Loading