|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20240322094407 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql('drop table if exists "money_amount" cascade;') |
|
6
|
} |
|
7
|
|
|
8
|
async down(): Promise<void> { |
|
9
|
this.addSql( |
|
10
|
'create table if not exists "money_amount" ("id" text not null, "currency_code" text not null, "amount" numeric not null, "min_quantity" numeric null, "max_quantity" numeric null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "money_amount_pkey" primary key ("id"));' |
|
11
|
) |
|
12
|
this.addSql( |
|
13
|
'CREATE INDEX IF NOT EXISTS "IDX_money_amount_currency_code" ON "money_amount" (currency_code) WHERE deleted_at IS NULL;' |
|
14
|
) |
|
15
|
this.addSql( |
|
16
|
'CREATE INDEX IF NOT EXISTS "IDX_money_amount_deleted_at" ON "money_amount" (deleted_at) WHERE deleted_at IS NOT NULL;' |
|
17
|
) |
|
18
|
} |
|
19
|
} |