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:
@ -37,6 +37,9 @@ services:
|
||||
- ../../shared/clickhouse/07_ai_features_view.sql:/initdb-src/07_ai_features_view.sql:ro
|
||||
- ../../shared/clickhouse/08_users.sql:/initdb-src/08_users.sql:ro
|
||||
- ../../shared/clickhouse/09_audit_table.sql:/initdb-src/09_audit_table.sql:ro
|
||||
- ../../shared/clickhouse/10_perf_indexes.sql:/initdb-src/10_perf_indexes.sql:ro
|
||||
- ../../shared/clickhouse/11_views.sql:/initdb-src/11_views.sql:ro
|
||||
- ../../shared/clickhouse/12_thesis_features.sql:/initdb-src/12_thesis_features.sql:ro
|
||||
# Empty CSV stubs (dictionaries expect these files)
|
||||
- ./platform/csv-stubs:/var/lib/clickhouse/user_files
|
||||
ports:
|
||||
|
||||
@ -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
|
||||
|
||||
# ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user