-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(order): align mikroorm <> order module (#8710)
what: - aligns the order module migrations with mikroorm snapshot
- Loading branch information
Showing
8 changed files
with
2,609 additions
and
385 deletions.
There are no files selected for viewing
2,875 changes: 2,524 additions & 351 deletions
2,875
packages/modules/order/src/migrations/.snapshot-medusa-order.json
Large diffs are not rendered by default.
Oops, something went wrong.
43 changes: 43 additions & 0 deletions
43
packages/modules/order/src/migrations/Migration20240821164505.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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";') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters