Files
medusa-store/packages/modules/index/src/migrations/Migration20250127105159.ts
Adrien de Peretti ea402875a5 Feat/index sync data (#11169)
**what**
Synchronisation process  implementation for configured entity to be indexed
2025-01-27 13:56:12 +00:00

22 lines
806 B
TypeScript

import { Migration } from "@mikro-orm/migrations"
export class Migration20250127105159 extends Migration {
override async up(): Promise<void> {
this.addSql(
`alter table if exists "index_relation" alter column "id" set not null;`
)
this.addSql(
`alter table if exists "index_relation" add constraint "IDX_index_relation_id_pivot_parent_name_child_name_parent_id_child_id_unique" unique ("parent_id", "child_id", "child_name", "parent_name", "pivot");`
)
}
override async down(): Promise<void> {
this.addSql(
`alter table if exists "index_relation" drop constraint "IDX_index_relation_id_pivot_parent_name_child_name_parent_id_child_id_unique";`
)
this.addSql(
`alter table if exists "index_relation" alter column "id" drop not null;`
)
}
}