fix: derive PG schema from tenant ID instead of defaulting to public
Schema now defaults to tenant_${cameleer.tenant.id} (e.g. tenant_default,
tenant_acme) instead of public. Flyway create-schemas: true ensures the
schema is auto-created on first startup. CAMELEER_DB_SCHEMA env var still
available as override for feature branch isolation. Removed hardcoded
public schema from K8s base and main overlay.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -3,18 +3,19 @@ server:
|
||||
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:public}
|
||||
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:tenant_${cameleer.tenant.id}}
|
||||
username: cameleer
|
||||
password: ${CAMELEER_DB_PASSWORD:cameleer_dev}
|
||||
driver-class-name: org.postgresql.Driver
|
||||
flyway:
|
||||
enabled: true
|
||||
locations: classpath:db/migration
|
||||
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:public},public
|
||||
url: jdbc:postgresql://localhost:5432/cameleer3?currentSchema=${CAMELEER_DB_SCHEMA:tenant_${cameleer.tenant.id}},public
|
||||
user: ${spring.datasource.username}
|
||||
password: ${spring.datasource.password}
|
||||
schemas: ${CAMELEER_DB_SCHEMA:public}
|
||||
default-schema: ${CAMELEER_DB_SCHEMA:public}
|
||||
schemas: ${CAMELEER_DB_SCHEMA:tenant_${cameleer.tenant.id}}
|
||||
default-schema: ${CAMELEER_DB_SCHEMA:tenant_${cameleer.tenant.id}}
|
||||
create-schemas: true
|
||||
mvc:
|
||||
async:
|
||||
request-timeout: -1
|
||||
|
||||
Reference in New Issue
Block a user