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 MigrationName1742302093234 {
    constructor() {
        this.name = "MigrationName1742302093234";
    }
    async up(queryRunner) {
        await queryRunner.query(`CREATE TABLE "MonitorFeed" ("_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, "monitorId" uuid NOT NULL, "createdByUserId" uuid, "deletedByUserId" uuid, "feedInfoInMarkdown" text NOT NULL, "moreInformationInMarkdown" text, "monitorFeedEventType" character varying NOT NULL, "displayColor" character varying(10) NOT NULL, "userId" uuid, "postedAt" TIMESTAMP WITH TIME ZONE, CONSTRAINT "PK_9966ea209535f456f02654b300e" PRIMARY KEY ("_id"))`);
        await queryRunner.query(`CREATE INDEX "IDX_ff44b198d069485d5a1b67c800" ON "MonitorFeed" ("projectId") `);
        await queryRunner.query(`CREATE INDEX "IDX_24b84143b15a609c310bbbe0a1" ON "MonitorFeed" ("monitorId") `);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" ADD CONSTRAINT "FK_ff44b198d069485d5a1b67c8000" FOREIGN KEY ("projectId") REFERENCES "Project"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" ADD CONSTRAINT "FK_24b84143b15a609c310bbbe0a10" FOREIGN KEY ("monitorId") REFERENCES "Monitor"("_id") ON DELETE CASCADE ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" ADD CONSTRAINT "FK_211b1c90f65e6f121771964039c" FOREIGN KEY ("createdByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" ADD CONSTRAINT "FK_175252c1e94dbb49d7a8c921c21" FOREIGN KEY ("deletedByUserId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" ADD CONSTRAINT "FK_0bbe0d94cdca54573f3f9860619" FOREIGN KEY ("userId") REFERENCES "User"("_id") ON DELETE SET NULL ON UPDATE NO ACTION`);
    }
    async down(queryRunner) {
        await queryRunner.query(`ALTER TABLE "MonitorFeed" DROP CONSTRAINT "FK_0bbe0d94cdca54573f3f9860619"`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" DROP CONSTRAINT "FK_175252c1e94dbb49d7a8c921c21"`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" DROP CONSTRAINT "FK_211b1c90f65e6f121771964039c"`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" DROP CONSTRAINT "FK_24b84143b15a609c310bbbe0a10"`);
        await queryRunner.query(`ALTER TABLE "MonitorFeed" DROP CONSTRAINT "FK_ff44b198d069485d5a1b67c8000"`);
        await queryRunner.query(`DROP INDEX "public"."IDX_24b84143b15a609c310bbbe0a1"`);
        await queryRunner.query(`DROP INDEX "public"."IDX_ff44b198d069485d5a1b67c800"`);
        await queryRunner.query(`DROP TABLE "MonitorFeed"`);
    }
}
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1742302093234.prototype, "up", null);
__decorate([
    CaptureSpan(),
    __metadata("design:type", Function),
    __metadata("design:paramtypes", [Object]),
    __metadata("design:returntype", Promise)
], MigrationName1742302093234.prototype, "down", null);
//# sourceMappingURL=1742302093234-MigrationName.js.map