I created 2 DB’s Temporal and Temporal visibility. I ran the Temporal_Tools\temporal\schema\postgresql\v12\temporal\schema.sql and other one for Visibility. It had created tables in public schema that is not recommended approach right. Now I am trying to create with temporal-sql-tool with custom schema. Can you provide the correct process to create the schema in postgres.
Build temporal-sql-tool from the Temporal repo
The official README describes how to build it:
git clone https://github.com/temporalio/temporal.git
cd temporal
make temporal-sql-tool
./temporal-sql-tool --help
set up Temporal with PostgreSQL, you need to:
-
Initialize schema versioning tables (one time per DB):
./temporal-sql-tool --plugin postgres --ep localhost -p 5432 -u temporal -pw temporal --db temporal setup-schema -v 0.0
./temporal-sql-tool --plugin postgres --ep localhost -p 5432 -u temporal -pw temporal --db temporal_visibility setup-schema -v 0.0 -
Apply the Temporal core schema (pick the right Postgres version dir, e.g. v96 or v12):
./temporal-sql-tool \
–plugin postgres \
–ep localhost -p 5432 -u temporal -pw temporal \
–db temporal \
update-schema -d ./schema/postgresql/v96/temporal/versioned