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 DropServiceDependencyTable1779277271302 {
    constructor() {
        this.name = "DropServiceDependencyTable1779277271302";
    }
    async up(queryRunner) {
        await queryRunner.query(`DROP TABLE IF EXISTS "ServiceDependency" CASCADE`);
    }
    async down(queryRunner) {
        await queryRunner.query(`CREATE TABLE "ServiceDependency" ("_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, "serviceId" uuid NOT NULL, "dependencyServiceId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, CONSTRAINT "PK_f4c8003faa6daec34a5b97f88e8" PRIMARY KEY ("_id"))`);
        await queryRunner.query(`CREATE INDEX "IDX_3e2a1ef7e8795a46c2e2e9955c" ON "ServiceDependency" ("projectId")`);
        await queryRunner.query(`CREATE INDEX "IDX_3af01e69f3e28ae56a968bbd81" ON "ServiceDependency" ("serviceId")`);
        await queryRunner.query(`CREATE INDEX "IDX_c2562045902370ec46091924fc" ON "ServiceDependency" ("dependencyServiceId")`);
        await queryRunner.query(`ALTER TABLE "ServiceDependency" ADD CONSTRAINT "FK_3e2a1ef7e8795a46c2e2e9955c2" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "ServiceDependency" ADD CONSTRAINT "FK_3af01e69f3e28ae56a968bbd812" FOREIGN KEY ("serviceId") REFERENCES "Service"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "ServiceDependency" ADD CONSTRAINT "FK_c2562045902370ec46091924fc8" FOREIGN KEY ("dependencyServiceId") REFERENCES "Service"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "ServiceDependency" ADD CONSTRAINT "FK_cc8c8d41106bebab21d1c69e129" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "ServiceDependency" ADD CONSTRAINT "FK_feb830e4e4f8259a871105b16e8" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], DropServiceDependencyTable1779277271302.prototype, "up", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], DropServiceDependencyTable1779277271302.prototype, "down", null);
//# sourceMappingURL=1779277271302-DropServiceDependencyTable.js.map