Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Update 20251018061215_sub-org.ts

Daniel Hougaard128e70be1089
diff --git a/backend/src/db/migrations/20251018061215_sub-org.ts b/backend/src/db/migrations/20251018061215_sub-org.ts
index 1c1d6df748..6378fa66a9 100644
--- a/backend/src/db/migrations/20251018061215_sub-org.ts
+++ b/backend/src/db/migrations/20251018061215_sub-org.ts
@@ -41,6 +41,8 @@ export async function up(knex: Knex): Promise<void> {
[TableName.Identity, TableName.Membership, AccessScope.Organization]
);
+ await knex.raw(`DELETE FROM ?? WHERE "orgId" IS NULL`, [TableName.Identity]);
+
await knex.schema.alterTable(TableName.Identity, (t) => {
t.uuid("orgId").notNullable().alter();
});