var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
    return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var __metadata = (this && this.__metadata) || function (k, v) {
    if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
};
import CaptureSpan from "../../../Utils/Telemetry/CaptureSpan";
export class MigrationName1736788706141 {
    constructor() {
        this.name = "MigrationName1736788706141";
    }
    async up(queryRunner) {
        await queryRunner.query(`ALTER TABLE "IncidentFeed" ADD "userId" uuid`);
        await queryRunner.query(`ALTER TABLE "AlertFeed" ADD "userId" uuid`);
        await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceFeed" ADD "userId" uuid`);
        await queryRunner.query(`ALTER TABLE "IncidentFeed" ADD CONSTRAINT "FK_010577090e59583da93c867f541" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "AlertFeed" ADD CONSTRAINT "FK_97b19fbc90b6105614cc0cba300" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceFeed" ADD CONSTRAINT "FK_541c2b40579cbf342c8850ced2b" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
    }
    async down(queryRunner) {
        await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceFeed" DROP CONSTRAINT "FK_541c2b40579cbf342c8850ced2b"`);
        await queryRunner.query(`ALTER TABLE "AlertFeed" DROP CONSTRAINT "FK_97b19fbc90b6105614cc0cba300"`);
        await queryRunner.query(`ALTER TABLE "IncidentFeed" DROP CONSTRAINT "FK_010577090e59583da93c867f541"`);
        await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceFeed" DROP COLUMN "userId"`);
        await queryRunner.query(`ALTER TABLE "AlertFeed" DROP COLUMN "userId"`);
        await queryRunner.query(`ALTER TABLE "IncidentFeed" DROP COLUMN "userId"`);
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1736788706141.prototype, "up", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1736788706141.prototype, "down", null);
//# sourceMappingURL=1736788706141-MigrationName.js.map