Skip to content

Commit

Permalink
fix: align db schema everywhere and make it app
Browse files Browse the repository at this point in the history
  • Loading branch information
mishraomp committed Jan 8, 2025
1 parent 6a72489 commit c40b353
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion backend/src/prisma.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const DB_USER = process.env.POSTGRES_USER || "postgres";
const DB_PWD = encodeURIComponent(process.env.POSTGRES_PASSWORD || "default"); // this needs to be encoded, if the password contains special characters it will break connection string.
const DB_PORT = process.env.POSTGRES_PORT || 5432;
const DB_NAME = process.env.POSTGRES_DATABASE || "postgres";
const DB_SCHEMA = process.env.POSTGRES_SCHEMA || "users";
const DB_SCHEMA = process.env.POSTGRES_SCHEMA || "app";
const dataSourceURL = `postgresql://${DB_USER}:${DB_PWD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?schema=${DB_SCHEMA}&connection_limit=5`;

@Injectable({ scope: Scope.DEFAULT})
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ services:
FLYWAY_USER: *POSTGRES_USER
FLYWAY_PASSWORD: *POSTGRES_PASSWORD
FLYWAY_BASELINE_ON_MIGRATE: true
FLYWAY_DEFAULT_SCHEMA: users
FLYWAY_DEFAULT_SCHEMA: app
depends_on:
database:
condition: service_healthy
Expand All @@ -43,7 +43,7 @@ services:
image: schemaspy/schemaspy:6.2.4
profiles: ["schemaspy"]
container_name: schemaspy
command: -t pgsql11 -db postgres -host database -port 5432 -u postgres -p default -schemas users
command: -t pgsql11 -db postgres -host database -port 5432 -u postgres -p default -schemas app
depends_on:
migrations:
condition: service_completed_successfully
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/api/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ resource "aws_ecs_task_definition" "node_api_task" {
value = var.db_name
},
{
name = "DB_SCHEMA"
name = "POSTGRES_SCHEMA"
value = "${var.db_schema}"
}
,
Expand Down

0 comments on commit c40b353

Please sign in to comment.