From 3a961c09ceff7f7cc22b9ae3fefbae776cb706aa Mon Sep 17 00:00:00 2001 From: Pau Costa Date: Sat, 28 Mar 2026 18:54:01 +0100 Subject: [PATCH] Add organization details to schema and update PostgreSQL health check - Add `language`, `logoId`, and `logoUrl` columns to the `Organization` table with relevant constraints and indexes. - Update `docker-compose.yml` to support dynamic environment variables in PostgreSQL health check. --- .idea/workspace.xml | 28 +++++++++++++++---- .../migration.sql | 10 +++++++ docker-compose.yml | 2 +- 3 files changed, 33 insertions(+), 7 deletions(-) create mode 100644 apps/api/prisma/migrations/20260328180000_add_organization_details/migration.sql diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 3d35eb0..5ed7019 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,7 @@ - - @@ -410,6 +424,8 @@ - \ No newline at end of file diff --git a/apps/api/prisma/migrations/20260328180000_add_organization_details/migration.sql b/apps/api/prisma/migrations/20260328180000_add_organization_details/migration.sql new file mode 100644 index 0000000..51a0fcf --- /dev/null +++ b/apps/api/prisma/migrations/20260328180000_add_organization_details/migration.sql @@ -0,0 +1,10 @@ +-- AlterTable +ALTER TABLE "Organization" ADD COLUMN "language" TEXT NOT NULL DEFAULT 'en', +ADD COLUMN "logoId" TEXT, +ADD COLUMN "logoUrl" TEXT; + +-- CreateIndex +CREATE UNIQUE INDEX "Organization_logoId_key" ON "Organization"("logoId"); + +-- AddForeignKey +ALTER TABLE "Organization" ADD CONSTRAINT "Organization_logoId_fkey" FOREIGN KEY ("logoId") REFERENCES "Asset"("id") ON DELETE SET NULL ON UPDATE CASCADE; diff --git a/docker-compose.yml b/docker-compose.yml index ea38aad..cf1331f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,7 +12,7 @@ services: volumes: - postgres_data:/var/lib/postgresql/data healthcheck: - test: ["CMD-SHELL", "pg_isready -U postgres -d hotdesking"] + test: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER:-postgres} -d $${POSTGRES_DB:-hotdesking}"] interval: 5s timeout: 5s retries: 5