"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.LeaveDocument1780980000000 = void 0;
class LeaveDocument1780980000000 {
    constructor() {
        this.name = 'LeaveDocument1780980000000';
    }
    async up(queryRunner) {
        const table = await queryRunner.getTable('leaves');
        const hasDocument = table?.columns.some((column) => column.name === 'document');
        if (!hasDocument) {
            await queryRunner.query(`ALTER TABLE \`leaves\` ADD \`document\` json NULL AFTER \`reason\``);
        }
    }
    async down(queryRunner) {
        const table = await queryRunner.getTable('leaves');
        const hasDocument = table?.columns.some((column) => column.name === 'document');
        if (hasDocument) {
            await queryRunner.query(`ALTER TABLE \`leaves\` DROP COLUMN \`document\``);
        }
    }
}
exports.LeaveDocument1780980000000 = LeaveDocument1780980000000;
//# sourceMappingURL=1780980000000-LeaveDocument.js.map