Skip to content

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

misc: add indices for referencing columns in identity access token

Sheen Capadngan978a3e582860
diff --git a/backend/src/db/migrations/20250630170849_add-index-for-access-token.ts b/backend/src/db/migrations/20250630170849_add-index-for-access-token.ts
new file mode 100644
index 0000000000..416ff14bb2
--- /dev/null
+++ b/backend/src/db/migrations/20250630170849_add-index-for-access-token.ts
@@ -0,0 +1,25 @@
+import { Knex } from "knex";
+
+import { TableName } from "../schemas";
+
+export async function up(knex: Knex): Promise<void> {
+ await knex.raw(`
+ CREATE INDEX IF NOT EXISTS ${TableName.IdentityAccessToken}_identityid_index
+ ON ${TableName.IdentityAccessToken} ("identityId")
+ `);
+
+ await knex.raw(`
+ CREATE INDEX IF NOT EXISTS ${TableName.IdentityAccessToken}_identityuaclientsecretid_index
+ ON ${TableName.IdentityAccessToken} ("identityUAClientSecretId")
+ `);
+}
+
+export async function down(knex: Knex): Promise<void> {
+ await knex.raw(`
+ DROP INDEX IF EXISTS ${TableName.IdentityAccessToken}_identityid_index
+ `);
+
+ await knex.raw(`
+ DROP INDEX IF EXISTS ${TableName.IdentityAccessToken}_identityuaclientsecretid_index
+ `);
+}