"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddStatusToDevices1786100653473 = void 0;
const typeorm_1 = require("typeorm");
class AddStatusToDevices1786100653473 {
    async up(queryRunner) {
        const table = await queryRunner.getTable('devices');
        if (table?.findColumnByName('status')) {
            return;
        }
        await queryRunner.addColumn('devices', new typeorm_1.TableColumn({
            name: 'status',
            type: 'enum',
            enum: ['active', 'background', 'closed'],
            default: "'closed'",
            isNullable: false,
        }));
    }
    async down(queryRunner) {
        const table = await queryRunner.getTable('devices');
        if (table?.findColumnByName('status')) {
            await queryRunner.dropColumn('devices', 'status');
        }
    }
}
exports.AddStatusToDevices1786100653473 = AddStatusToDevices1786100653473;
//# sourceMappingURL=1786100653473-AddStatusToDevices.js.map