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[]