import { Migration } from '@mikro-orm/migrations'; export class Migration20260517132951_AddConfigModule extends Migration { override async up(): Promise { this.addSql(`create table "configs" ("id" char(26) not null, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, "key" varchar(255) not null, "value" varchar(255) not null, "shop_id" char(26) null, constraint "configs_pkey" primary key ("id"));`); this.addSql(`create index "configs_created_at_index" on "configs" ("created_at");`); this.addSql(`create index "configs_deleted_at_index" on "configs" ("deleted_at");`); this.addSql(`alter table "configs" add constraint "configs_shop_id_key_unique" unique ("shop_id", "key");`); this.addSql(`alter table "configs" add constraint "configs_shop_id_foreign" foreign key ("shop_id") references "shops" ("id") on update cascade on delete set null;`); this.addSql(`alter table "point_transactions" drop constraint if exists "point_transactions_type_check";`); this.addSql(`alter table "point_transactions" add constraint "point_transactions_type_check" check("type" in (''));`); } override async down(): Promise { this.addSql(`alter table "point_transactions" drop constraint if exists "point_transactions_type_check";`); this.addSql(`alter table "point_transactions" add constraint "point_transactions_type_check" check("type" in (''));`); } }