db:schema:load is not idempotent
AlexKichkailo opened this issue · comments
If you try to run db:schema:load
multiple times, an error is thrown
DB::Exception: Table <DB>.ar_internal_metadata already exists. **(TABLE_ALREADY_EXISTS)**
It appears that the clickhouse_structure.sql
file generated by the clickhouse-activerecord adapter is missing DROP TABLE IF EXISTS
statements.
In Rails, db:schema:load
is supposed to be idempotent so it could be used to reset the DB in a test or dev environment.