1 import { Migration } from "@medusajs/framework/mikro-orm/migrations"
2
3 export class InitialSetup20240221144943 extends Migration {
4 async up(): Promise<void> {
5 this.addSql(
6 'create table if not exists "api_key" ("id" text not null, "token" text not null, "salt" text not null, "redacted" text not null, "title" text not null, "type" text not null, "last_used_at" timestamptz null, "created_by" text not null, "created_at" timestamptz not null default now(), "revoked_by" text null, "revoked_at" timestamptz null, constraint "api_key_pkey" primary key ("id"));'
7 )
8 this.addSql(
9 'CREATE UNIQUE INDEX IF NOT EXISTS "IDX_api_key_token_unique" ON "api_key" (token);'
10 )
11 this.addSql(
12 'CREATE INDEX IF NOT EXISTS "IDX_api_key_type" ON "api_key" (type);'
13 )
14 }
15 }