Skip to content

Commit d8bb312

Browse files
committed
fix: always create visibility database when configured
Signed-off-by: “Kevin” <kevlar_ksb@yahoo.com>
1 parent be5335d commit d8bb312

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

charts/cadence/templates/schema-server-job.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -458,8 +458,8 @@ spec:
458458
echo "Updating main schema to latest version"
459459
$(build_cassandra_cmd) -k $DB_NAME update-schema -d $CADENCE_HOME/schema/cassandra/cadence/versioned || echo "Rollback is not allowed"
460460
461-
# Setup visibility database schema (only if ES is not enabled)
462-
if [ "$ES_ENABLED" = "false" ]; then
461+
# Setup visibility database schema (if configured)
462+
if [ -n "$DB_VISIBILITY_NAME" ]; then
463463
echo "Creating visibility keyspace: $DB_VISIBILITY_NAME"
464464
if [ "$DATA_CENTER" = "" ]; then
465465
$(build_cassandra_cmd) create -k $DB_VISIBILITY_NAME --rf $REPLICATION_FACTOR || echo "Keyspace already exists"
@@ -473,7 +473,7 @@ spec:
473473
echo "Updating visibility schema to latest version"
474474
$(build_cassandra_cmd) -k $DB_VISIBILITY_NAME update-schema -d $CADENCE_HOME/schema/cassandra/visibility/versioned || echo "Rollback is not allowed"
475475
else
476-
echo "Skipping visibility schema setup (Elasticsearch enabled)"
476+
echo "Skipping visibility schema setup (no visibility keyspace configured)"
477477
fi
478478
479479
echo "Schema setup completed successfully!"
@@ -580,8 +580,8 @@ spec:
580580
echo "Updating main schema to latest version"
581581
$(build_postgres_cmd) --db $DB_NAME update-schema -d $CADENCE_HOME/schema/postgres/cadence/versioned || echo "Rollback is not allowed"
582582
583-
# Setup visibility database (only if ES is not enabled)
584-
if [ "$ES_ENABLED" = "false" ]; then
583+
# Setup visibility database (if configured)
584+
if [ -n "$DB_VISIBILITY_NAME" ]; then
585585
echo "Creating visibility database: $DB_VISIBILITY_NAME"
586586
$(build_postgres_cmd) create-database --db $DB_VISIBILITY_NAME || echo "Database already exists"
587587
@@ -591,7 +591,7 @@ spec:
591591
echo "Updating visibility schema to latest version"
592592
$(build_postgres_cmd) --db $DB_VISIBILITY_NAME update-schema -d $CADENCE_HOME/schema/postgres/visibility/versioned || echo "Rollback is not allowed"
593593
else
594-
echo "Skipping visibility schema setup (Elasticsearch enabled)"
594+
echo "Skipping visibility schema setup (no visibility database configured)"
595595
fi
596596
597597
echo "Schema setup completed successfully!"
@@ -685,8 +685,8 @@ spec:
685685
echo "Updating main schema to latest version"
686686
$(build_mysql_cmd) --db $DB_NAME update-schema -d $CADENCE_HOME/schema/mysql/v8/cadence/versioned || echo "Rollback is not allowed"
687687
688-
# Setup visibility database (only if ES is not enabled)
689-
if [ "$ES_ENABLED" = "false" ]; then
688+
# Setup visibility database (if configured)
689+
if [ -n "$DB_VISIBILITY_NAME" ]; then
690690
echo "Creating visibility database: $DB_VISIBILITY_NAME"
691691
$(build_mysql_cmd) create-database --db $DB_VISIBILITY_NAME || echo "Database already exists"
692692
@@ -696,7 +696,7 @@ spec:
696696
echo "Updating visibility schema to latest version"
697697
$(build_mysql_cmd) --db $DB_VISIBILITY_NAME update-schema -d $CADENCE_HOME/schema/mysql/v8/visibility/versioned || echo "Rollback is not allowed"
698698
else
699-
echo "Skipping visibility schema setup (Elasticsearch enabled)"
699+
echo "Skipping visibility schema setup (no visibility database configured)"
700700
fi
701701
702702
echo "Schema setup completed successfully!"

0 commit comments

Comments
 (0)