-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
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
21 changes: 21 additions & 0 deletions
21
packages/modules/pricing/src/migrations/Migration20241127223829.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,21 @@ | ||
import { Migration } from "@mikro-orm/migrations" | ||
|
||
export class Migration20241127223829 extends Migration { | ||
async up(): Promise<void> { | ||
this.addSql( | ||
'drop index if exists "IDX_price_rule_price_id_attribute_unique";' | ||
) | ||
this.addSql( | ||
'CREATE UNIQUE INDEX IF NOT EXISTS "IDX_price_rule_price_id_attribute_operator_unique" ON "price_rule" (price_id, attribute, operator) WHERE deleted_at IS NULL;' | ||
) | ||
} | ||
|
||
async down(): Promise<void> { | ||
this.addSql( | ||
'drop index if exists "IDX_price_rule_price_id_attribute_operator_unique";' | ||
) | ||
this.addSql( | ||
'CREATE UNIQUE INDEX IF NOT EXISTS "IDX_price_rule_price_id_attribute_unique" ON "price_rule" (price_id, attribute) WHERE deleted_at IS NULL;' | ||
) | ||
} | ||
} |
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