fix(integration): mount missing SQL files 10-12 in ClickHouse init

3 SQL files were missing from the docker-compose.yml volume mounts:
- 10_perf_indexes.sql (performance indexes)
- 11_views.sql (dashboard views)
- 12_thesis_features.sql (thesis §5 MVs and views)

Also make 10_perf_indexes.sql non-fatal in init script since ALTER TABLE
ADD INDEX may fail if index already exists.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
toto
2026-04-08 02:55:43 +02:00
parent 8d58f2b932
commit 228ad7026a
2 changed files with 12 additions and 2 deletions

View File

@ -23,8 +23,15 @@ done
for f in "$TMP_DIR"/*.sql; do
[ -f "$f" ] || continue
echo "[init] Executing $(basename "$f")"
clickhouse-client --multiquery < "$f"
base=$(basename "$f")
echo "[init] Executing $base"
# 10_perf_indexes.sql uses ALTER TABLE ADD INDEX which may fail if index
# already exists — allow non-zero exit for migration/perf scripts
if [[ "$base" == 10_* ]]; then
clickhouse-client --multiquery < "$f" || echo "[init] WARNING: $base had errors (expected for duplicate indexes)"
else
clickhouse-client --multiquery < "$f"
fi
done
# ---------------------------------------------------------------------------