chore(): improve cart operations + Mikro orm 6.4.16 (#13712)
* chore(): Mikro orm 6.4.16 * Create small-ghosts-draw.md * update config * update config * fix delete * update config * update workflows * order improvements * test pricing quuery * test pricing quuery * configurable connection options * configurable connection options * configurable connection options * Update packages/modules/pricing/src/models/price.ts Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com> --------- Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
This commit is contained in:
co-authored by
Oli Juhl
parent
76bf364440
commit
c54c5ed6de
@@ -136,6 +136,15 @@
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_list_deleted_at\" ON \"price_list\" (deleted_at) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_price_list_id_status_starts_at_ends_at",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_list_id_status_starts_at_ends_at\" ON \"price_list\" (id, status, starts_at, ends_at) WHERE deleted_at IS NULL AND status = 'active'"
|
||||
},
|
||||
{
|
||||
"keyName": "price_list_pkey",
|
||||
"columnNames": [
|
||||
@@ -252,6 +261,15 @@
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_list_rule_attribute\" ON \"price_list_rule\" (attribute) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_price_list_rule_value",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_list_rule_value\" ON \"price_list_rule\" USING gin (value) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "price_list_rule_pkey",
|
||||
"columnNames": [
|
||||
@@ -625,6 +643,15 @@
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_currency_code\" ON \"price\" (currency_code) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_price_currency_code_price_set_id_min_quantity",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_currency_code_price_set_id_min_quantity\" ON \"price\" (currency_code, price_set_id, min_quantity) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "price_pkey",
|
||||
"columnNames": [
|
||||
@@ -822,6 +849,15 @@
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_rule_operator_value\" ON \"price_rule\" (operator, value) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "IDX_price_rule_attribute_value_price_id",
|
||||
"columnNames": [],
|
||||
"composite": false,
|
||||
"constraint": false,
|
||||
"primary": false,
|
||||
"unique": false,
|
||||
"expression": "CREATE INDEX IF NOT EXISTS \"IDX_price_rule_attribute_value_price_id\" ON \"price_rule\" (attribute, value, price_id) WHERE deleted_at IS NULL"
|
||||
},
|
||||
{
|
||||
"keyName": "price_rule_pkey",
|
||||
"columnNames": [
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
import { Migration } from "@mikro-orm/migrations"
|
||||
|
||||
export class Migration20251009110625 extends Migration {
|
||||
override async up(): Promise<void> {
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_price_list_id_status_starts_at_ends_at" ON "price_list" (id, status, starts_at, ends_at) WHERE deleted_at IS NULL AND status = 'active';`
|
||||
)
|
||||
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_price_list_rule_value" ON "price_list_rule" USING gin (value) WHERE deleted_at IS NULL;`
|
||||
)
|
||||
this.addSql(
|
||||
`CREATE INDEX IF NOT EXISTS "IDX_price_rule_attribute_value_price_id" ON "price_rule" (attribute, value, price_id) WHERE deleted_at IS NULL;`
|
||||
)
|
||||
}
|
||||
|
||||
override async down(): Promise<void> {
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_price_list_id_status_starts_at_ends_at";`
|
||||
)
|
||||
|
||||
this.addSql(`drop index if exists "IDX_price_list_rule_value";`)
|
||||
|
||||
this.addSql(
|
||||
`drop index if exists "IDX_price_rule_attribute_value_price_id";`
|
||||
)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user