From 912bc24e9cea93d7ce110f09220b20947c9cea85 Mon Sep 17 00:00:00 2001 From: SimonLoir Date: Thu, 11 Dec 2025 14:01:47 +0100 Subject: [PATCH] chore: bump `apps/web` to v0.11.6 and update Prisma schema for multi-registry support - Updated `apps/web/package.json` version to `0.11.6`. - Modified Prisma schema to enable support for multiple registries per organization. - Added migration to drop `registryId` column, create a join table, and update relationships. --- apps/web/package.json | 2 +- .../migration.sql | 28 +++++++++++++++++++ packages/db/prisma/schema.prisma | 3 +- 3 files changed, 30 insertions(+), 3 deletions(-) create mode 100644 packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql diff --git a/apps/web/package.json b/apps/web/package.json index 0cec4ff..6b8ec80 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -1,6 +1,6 @@ { "name": "web", - "version": "0.11.5", + "version": "0.11.6", "type": "module", "private": true, "scripts": { diff --git a/packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql b/packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql new file mode 100644 index 0000000..60a665d --- /dev/null +++ b/packages/db/prisma/migrations/20251211125015_allow_multiple_registries_on_organization/migration.sql @@ -0,0 +1,28 @@ +/* + Warnings: + + - You are about to drop the column `registryId` on the `organization` table. All the data in the column will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "organization" DROP CONSTRAINT "organization_registryId_fkey"; + +-- AlterTable +ALTER TABLE "organization" DROP COLUMN "registryId"; + +-- CreateTable +CREATE TABLE "_OrganizationToRegistry" ( + "A" TEXT NOT NULL, + "B" TEXT NOT NULL, + + CONSTRAINT "_OrganizationToRegistry_AB_pkey" PRIMARY KEY ("A","B") +); + +-- CreateIndex +CREATE INDEX "_OrganizationToRegistry_B_index" ON "_OrganizationToRegistry"("B"); + +-- AddForeignKey +ALTER TABLE "_OrganizationToRegistry" ADD CONSTRAINT "_OrganizationToRegistry_A_fkey" FOREIGN KEY ("A") REFERENCES "organization"("id") ON DELETE CASCADE ON UPDATE CASCADE; + +-- AddForeignKey +ALTER TABLE "_OrganizationToRegistry" ADD CONSTRAINT "_OrganizationToRegistry_B_fkey" FOREIGN KEY ("B") REFERENCES "Registry"("id") ON DELETE CASCADE ON UPDATE CASCADE; diff --git a/packages/db/prisma/schema.prisma b/packages/db/prisma/schema.prisma index eef2fa7..e78c614 100644 --- a/packages/db/prisma/schema.prisma +++ b/packages/db/prisma/schema.prisma @@ -129,8 +129,7 @@ model Organization { projects Project[] servers Server[] sshKeys SSHKey[] - registries Registry? @relation(fields: [registryId], references: [id]) - registryId String? + registries Registry[] notificationProviders NotificationProvider[] notifications Notification[] storageDestinations StorageDestination[]