import { Migration } from "@medusajs/framework/mikro-orm/migrations";

export class Migration20260918120000 extends Migration {

  override async up(): Promise<void> {
    this.addSql(`create table if not exists "company_review" ("id" text not null, "author_name" text not null, "rating" integer not null, "body" text not null, "is_published" boolean not null default true, "created_at" timestamptz not null default now(), "updated_at" timestamptz not null default now(), "deleted_at" timestamptz null, constraint "company_review_pkey" primary key ("id"));`);
    this.addSql(`CREATE INDEX IF NOT EXISTS "IDX_company_review_deleted_at" ON "company_review" ("deleted_at") WHERE deleted_at IS NULL;`);
  }

  override async down(): Promise<void> {
    this.addSql(`drop table if exists "company_review" cascade;`);
  }

}
