|
1
|
import { Migration } from "@medusajs/framework/mikro-orm/migrations" |
|
2
|
|
|
3
|
export class Migration20231019174230 extends Migration { |
|
4
|
async up(): Promise<void> { |
|
5
|
this.addSql( |
|
6
|
`create table IF NOT EXISTS "index_data" ("id" text not null, "name" text not null, "data" jsonb not null default '{}', constraint "index_data_pkey" primary key ("id", "name")) PARTITION BY LIST("name");` |
|
7
|
) |
|
8
|
|
|
9
|
this.addSql( |
|
10
|
`create table IF NOT EXISTS "index_relation" ("id" bigserial, "pivot" text not null, "parent_id" text not null, "parent_name" text not null, "child_id" text not null, "child_name" text not null, constraint "index_relation_pkey" primary key ("id", "pivot")) PARTITION BY LIST("pivot");` |
|
11
|
) |
|
12
|
} |
|
13
|
} |