import { Migration } from "@mikro-orm/migrations";
class Migration20251031083009 extends Migration {
  constructor() {
    super(...arguments);
    this.oldConstraint = "roles_name_unique";
    this.newConstraint = "roles_tenant_id_name_unique";
  }
  async up() {
    this.addSql(`alter table "roles" drop constraint if exists "${this.oldConstraint}";`);
    this.addSql(`alter table "roles" add constraint "${this.newConstraint}" unique ("tenant_id", "name");`);
  }
  async down() {
    this.addSql(`alter table "roles" drop constraint if exists "${this.newConstraint}";`);
    this.addSql(`alter table "roles" add constraint "${this.oldConstraint}" unique ("name");`);
  }
}
export {
  Migration20251031083009
};
//# sourceMappingURL=Migration20251031083009.js.map
