Raw
1 import { Migration } from "@medusajs/framework/mikro-orm/migrations"
2
3 export class Migration20251015123842 extends Migration {
4 override async up(): Promise<void> {
5 this.addSql(
6 `CREATE INDEX IF NOT EXISTS "IDX_api_key_revoked_at" ON "api_key" (revoked_at) WHERE deleted_at IS NULL;`
7 )
8 this.addSql(
9 `CREATE INDEX IF NOT EXISTS "IDX_api_key_redacted" ON "api_key" (redacted) WHERE deleted_at IS NULL;`
10 )
11 }
12
13 override async down(): Promise<void> {
14 this.addSql(`drop index if exists "IDX_api_key_revoked_at";`)
15 this.addSql(`drop index if exists "IDX_api_key_redacted";`)
16 }
17 }