import { Migration } from '@mikro-orm/migrations';

export class Migration20260106192946 extends Migration {

  override async up(): Promise<void> {
    this.addSql(`alter table "contacts" add column "restaurant_id" char(26) null;`);
    this.addSql(`alter table "contacts" add constraint "contacts_restaurant_id_foreign" foreign key ("restaurant_id") references "restaurants" ("id") on update cascade on delete set null;`);
  }

  override async down(): Promise<void> {
    this.addSql(`alter table "contacts" drop constraint "contacts_restaurant_id_foreign";`);
  }

}
