File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,19 @@ if [ -n "$CLICKHOUSE_URL" ]; then
14
14
# Run ClickHouse migrations
15
15
echo " Running ClickHouse migrations..."
16
16
export GOOSE_DRIVER=clickhouse
17
- export GOOSE_DBSTRING=" $CLICKHOUSE_URL " # Use the full URL provided by the env var
17
+
18
+ # Ensure secure=true is in the connection string
19
+ if echo " $CLICKHOUSE_URL " | grep -q " secure=" ; then
20
+ # secure parameter already exists, use as is
21
+ export GOOSE_DBSTRING=" $CLICKHOUSE_URL "
22
+ elif echo " $CLICKHOUSE_URL " | grep -q " ?" ; then
23
+ # URL has query parameters, append secure=true
24
+ export GOOSE_DBSTRING=" ${CLICKHOUSE_URL} &secure=true"
25
+ else
26
+ # URL has no query parameters, add secure=true
27
+ export GOOSE_DBSTRING=" ${CLICKHOUSE_URL} ?secure=true"
28
+ fi
29
+
18
30
export GOOSE_MIGRATION_DIR=/triggerdotdev/internal-packages/clickhouse/schema
19
31
/usr/local/bin/goose up
20
32
echo " ClickHouse migrations complete."
You can’t perform that action at this time.
0 commit comments