improvement(enterprise): feature flagging + runtime checks consolidation (#2730)

* improvement(enterprise): enterprise checks code consolidation

* update docs

* revert isHosted check

* add unique index to prevent multiple orgs per user

* address greptile comments

* ui bug
This commit is contained in:
Vikhyath Mondreti
2026-01-08 13:53:22 -08:00
committed by GitHub
parent fdac4314d2
commit c2180bf8a0
29 changed files with 10218 additions and 137 deletions
@@ -0,0 +1,2 @@
DROP INDEX "member_user_id_idx";--> statement-breakpoint
CREATE UNIQUE INDEX "member_user_id_unique" ON "member" USING btree ("user_id");
File diff suppressed because it is too large Load Diff
@@ -946,6 +946,13 @@
"when": 1767737974016,
"tag": "0135_stormy_puff_adder",
"breakpoints": true
},
{
"idx": 136,
"version": "7",
"when": 1767905804764,
"tag": "0136_pretty_jack_flag",
"breakpoints": true
}
]
}
+1 -1
View File
@@ -824,7 +824,7 @@ export const member = pgTable(
createdAt: timestamp('created_at').defaultNow().notNull(),
},
(table) => ({
userIdIdx: index('member_user_id_idx').on(table.userId),
userIdUnique: uniqueIndex('member_user_id_unique').on(table.userId), // Users can only belong to one org
organizationIdIdx: index('member_organization_id_idx').on(table.organizationId),
})
)