improvement: newly created organization's subscriptions flow improved.
This commit is contained in:
5
backend/prisma/migrations/20260430134958/migration.sql
Normal file
5
backend/prisma/migrations/20260430134958/migration.sql
Normal file
@@ -0,0 +1,5 @@
|
||||
-- DropForeignKey
|
||||
ALTER TABLE "organizations" DROP CONSTRAINT "organizations_planId_fkey";
|
||||
|
||||
-- AddForeignKey
|
||||
ALTER TABLE "organizations" ADD CONSTRAINT "organizations_planId_fkey" FOREIGN KEY ("planId") REFERENCES "plans"("id") ON DELETE SET NULL ON UPDATE CASCADE;
|
||||
@@ -0,0 +1,3 @@
|
||||
-- Allow organizations without an active subscription plan.
|
||||
ALTER TABLE "organizations"
|
||||
ALTER COLUMN "planId" DROP NOT NULL;
|
||||
@@ -52,8 +52,8 @@ model Organization {
|
||||
owner User @relation("OrganizationOwner", fields: [ownerId], references: [id])
|
||||
|
||||
memberships Membership[]
|
||||
planId String
|
||||
plan Plan @relation(fields: [planId], references: [id])
|
||||
planId String?
|
||||
plan Plan? @relation(fields: [planId], references: [id])
|
||||
|
||||
sharedWithMe OrganizationLink[] @relation("OrganizationB")
|
||||
sharedWithOthers OrganizationLink[] @relation("OrganizationA")
|
||||
|
||||
Reference in New Issue
Block a user