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 MigrationName1730209089495 {
    constructor() {
        this.name = "MigrationName1730209089495";
    }
    async up(queryRunner) {
        await queryRunner.query(`CREATE TABLE "MonitorTest" ("_id" uuid NOT NULL DEFAULT uuid_generate_v4(), "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deletedAt" TIMESTAMP WITH TIME ZONE, "version" integer NOT NULL, "projectId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "monitorType" character varying(100) NOT NULL, "monitorSteps" jsonb, "probeId" uuid NOT NULL, "testedAt" TIMESTAMP WITH TIME ZONE, "lastMonitoringLog" jsonb, CONSTRAINT "PK_7ce3477c7bb3d7b8961c8465935" PRIMARY KEY ("_id"))`);
        await queryRunner.query(`CREATE INDEX "IDX_6de87954a2a0587defe52aeb86" ON "MonitorTest" ("projectId") `);
        await queryRunner.query(`CREATE INDEX "IDX_fd6b1e330eb08de988307b6052" ON "MonitorTest" ("probeId") `);
        await queryRunner.query(`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_6de87954a2a0587defe52aeb86c" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_f94c5a7356b7b55785e3a3dac5b" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_b92a71b1f5f6c072455cd242ed6" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" ADD CONSTRAINT "FK_fd6b1e330eb08de988307b60524" FOREIGN KEY ("probeId") REFERENCES "Probe"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
    }
    async down(queryRunner) {
        await queryRunner.query(`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_fd6b1e330eb08de988307b60524"`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_b92a71b1f5f6c072455cd242ed6"`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_f94c5a7356b7b55785e3a3dac5b"`);
        await queryRunner.query(`ALTER TABLE "MonitorTest" DROP CONSTRAINT "FK_6de87954a2a0587defe52aeb86c"`);
        await queryRunner.query(`DROP INDEX "public"."IDX_fd6b1e330eb08de988307b6052"`);
        await queryRunner.query(`DROP INDEX "public"."IDX_6de87954a2a0587defe52aeb86"`);
        await queryRunner.query(`DROP TABLE "MonitorTest"`);
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1730209089495.prototype, "up", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1730209089495.prototype, "down", null);
//# sourceMappingURL=1730209089495-MigrationName.js.map