import { Migration } from "@mikro-orm/migrations";
class Migration20260121082329 extends Migration {
  async up() {
    this.addSql(`create table "planner_availability_rules" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid not null, "subject_type" text check ("subject_type" in ('member', 'resource', 'ruleset')) not null, "subject_id" uuid not null, "timezone" text not null, "rrule" text not null, "exdates" jsonb not null default '[]', "kind" text check ("kind" in ('availability', 'unavailability')) not null default 'availability', "note" text null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "planner_availability_rules_pkey" primary key ("id"));`);
    this.addSql(`create index "planner_availability_rules_subject_idx" on "planner_availability_rules" ("subject_type", "subject_id", "tenant_id", "organization_id");`);
    this.addSql(`create index "planner_availability_rules_tenant_org_idx" on "planner_availability_rules" ("tenant_id", "organization_id");`);
    this.addSql(`create table "planner_availability_rule_sets" ("id" uuid not null default gen_random_uuid(), "tenant_id" uuid not null, "organization_id" uuid not null, "name" text not null, "description" text null, "timezone" text not null, "created_at" timestamptz not null, "updated_at" timestamptz not null, "deleted_at" timestamptz null, constraint "planner_availability_rule_sets_pkey" primary key ("id"));`);
    this.addSql(`create index "planner_availability_rule_sets_tenant_org_idx" on "planner_availability_rule_sets" ("tenant_id", "organization_id");`);
  }
  async down() {
    this.addSql(`drop index "planner_availability_rule_sets_tenant_org_idx";`);
    this.addSql(`drop index "planner_availability_rules_tenant_org_idx";`);
    this.addSql(`drop index "planner_availability_rules_subject_idx";`);
    this.addSql(`drop table "planner_availability_rule_sets";`);
    this.addSql(`drop table "planner_availability_rules";`);
  }
}
export {
  Migration20260121082329
};
//# sourceMappingURL=Migration20260121082329.js.map
