"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UpgradeLegacyScopeValues1780920000000 = void 0;
class UpgradeLegacyScopeValues1780920000000 {
    constructor() {
        this.name = 'UpgradeLegacyScopeValues1780920000000';
    }
    async up(queryRunner) {
        await queryRunner.query(`
      UPDATE role_permissions rp
      INNER JOIN access_roles ar ON ar.id = rp.role_id
      SET rp.permission_value = 'own_and_all'
      WHERE ar.slug IN ('owner', 'admin')
        AND rp.permission_value = 'all'
        AND rp.permission_key IN (
          'dashboard.view',
          'members.view',
          'members.update',
          'members.delete',
          'attendance.view',
          'leave.view',
          'leave.create',
          'leave.update',
          'leave.delete',
          'reports.view',
          'calendar.view',
          'holidays.view',
          'holidays.create',
          'holidays.update',
          'holidays.delete',
          'notice.view',
          'notice.create',
          'notice.update',
          'notice.delete'
        )
    `);
    }
    async down(_queryRunner) {
    }
}
exports.UpgradeLegacyScopeValues1780920000000 = UpgradeLegacyScopeValues1780920000000;
//# sourceMappingURL=1780920000000-UpgradeLegacyScopeValues.js.map