chore(order): align mikroorm <> order module (#8710)

what:

- aligns the order module migrations with mikroorm snapshot
This commit is contained in:
Riqwan Thamir
2024-08-21 17:37:17 +00:00
committed by GitHub
parent 24377053f0
commit 01583baf6d
8 changed files with 2469 additions and 245 deletions
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,43 @@
import { Migration } from "@mikro-orm/migrations"
export class Migration20240821164505 extends Migration {
async up(): Promise<void> {
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_item_deleted_at" ON "order_item" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_summary_deleted_at" ON "order_summary" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_claim_item_deleted_at" ON "order_claim_item" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_return_item_deleted_at" ON "return_item" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_shipping_deleted_at" ON "order_shipping" (deleted_at) WHERE deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_transaction_exchange_id" ON "order_transaction" (exchange_id) WHERE exchange_id IS NOT NULL AND deleted_at IS NOT NULL;'
)
this.addSql(
'CREATE INDEX IF NOT EXISTS "IDX_order_transaction_claim_id" ON "order_transaction" (claim_id) WHERE claim_id IS NOT NULL AND deleted_at IS NOT NULL;'
)
}
async down(): Promise<void> {
this.addSql('drop index if exists "IDX_order_item_deleted_at";')
this.addSql('drop index if exists "IDX_order_summary_deleted_at";')
this.addSql('drop index if exists "IDX_order_claim_item_deleted_at";')
this.addSql('drop index if exists "IDX_return_item_deleted_at";')
this.addSql('drop index if exists "IDX_order_shipping_deleted_at";')
this.addSql('drop index if exists "IDX_order_transaction_exchange_id";')
this.addSql('drop index if exists "IDX_order_transaction_claim_id";')
}
}