From e7bfe6ea47ffa61e33bdfa627fb2817a13b2265f Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Tue, 24 Sep 2024 18:50:08 +0100 Subject: [PATCH] Enhance logging for API responses to include request details and improve traceability --- .../1727195154237-MigrationName.ts | 256 ------------------ 1 file changed, 256 deletions(-) delete mode 100644 Common/Server/Infrastructure/Postgres/SchemaMigrations/1727195154237-MigrationName.ts diff --git a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727195154237-MigrationName.ts b/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727195154237-MigrationName.ts deleted file mode 100644 index b3e75b6b6f8..00000000000 --- a/Common/Server/Infrastructure/Postgres/SchemaMigrations/1727195154237-MigrationName.ts +++ /dev/null @@ -1,256 +0,0 @@ -import { MigrationInterface, QueryRunner } from "typeorm"; - -export class MigrationName1727195154237 implements MigrationInterface { - name = 'MigrationName1727195154237' - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "updatedAt"`); - await queryRunner.query(`ALTER TABLE "User" ADD "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "AcmeCertificate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "AcmeChallenge" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Reseller" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ResellerPlan" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Project" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ApiKey" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Label" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ApiKeyPermission" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "BillingInvoice" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "BillingPaymentMethod" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "CallLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "CopilotCodeRepository" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatalog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCopilotCodeRepository" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "CopilotPullRequest" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "CopilotAction" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "DataMigrations" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Domain" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ProjectSMTPConfig" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "EmailLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "EmailVerificationToken" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "GlobalConfig" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "GreenlockCertificate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "GreenlockChallenge" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentSeverity" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentState" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorStatus" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Monitor" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicy" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Probe" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Incident" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentCustomField" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentInternalNote" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentNoteTemplate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Team" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentPublicNote" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentStateTimeline" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentTemplate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentTemplateOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "IncidentTemplateOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorCustomField" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorGroup" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorGroupOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorGroupOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorGroupResource" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorProbe" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorSecret" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "MonitorStatusTimeline" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyCustomField" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRule" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicySchedule" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleSchedule" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyExecutionLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyExecutionLogTimeline" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type":"Recurring","value":{"intervalType":"Day","intervalCount":{"_type":"PositiveNumber","value":1}}}'`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type":"RestrictionTimes","value":{"restictionType":"None","dayRestrictionTimes":null,"weeklyRestrictionTimes":[]}}'`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ProbeOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ProbeOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ProjectCallSMSConfig" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ProjectSSO" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "PromoCode" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceState" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPage" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenance" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceCustomField" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceInternalNote" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceNoteTemplate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenancePublicNote" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceStateTimeline" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ShortLink" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "SmsLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncement" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageCustomField" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageDomain" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageFooterLink" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageGroup" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageHeaderLink" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageHistoryChartBarColorRule" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPagePrivateUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageResource" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageSSO" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "StatusPageSubscriber" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TeamMember" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TeamPermission" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TelemetryService" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TelemetryUsageBilling" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserCall" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserEmail" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserSMS" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserNotificationRule" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserNotificationSetting" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserOnCallLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserOnCallLogTimeline" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "Workflow" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "WorkflowLog" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "WorkflowVariable" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatlogDependency" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogMonitor" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogTelemetryService" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "UserTwoFactorAuth" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TelemetryIngestionKey" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "TelemetryException" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "CopilotActionTypePriority" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplate" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplateOwnerTeam" ALTER COLUMN "deletedAt" DROP DEFAULT`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplateOwnerUser" ALTER COLUMN "deletedAt" DROP DEFAULT`); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplateOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplateOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceTemplate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "CopilotActionTypePriority" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TelemetryException" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TelemetryIngestionKey" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserTwoFactorAuth" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogTelemetryService" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogMonitor" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatlogDependency" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "WorkflowVariable" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "WorkflowLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Workflow" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserOnCallLogTimeline" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserOnCallLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserNotificationSetting" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserNotificationRule" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserSMS" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserEmail" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "UserCall" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TelemetryUsageBilling" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TelemetryService" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TeamPermission" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "TeamMember" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageSubscriber" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageSSO" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageResource" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPagePrivateUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageHistoryChartBarColorRule" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageHeaderLink" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageGroup" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageFooterLink" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageDomain" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageCustomField" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPageAnnouncement" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "SmsLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ShortLink" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatalogOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceStateTimeline" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenancePublicNote" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceNoteTemplate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceInternalNote" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceCustomField" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenance" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "StatusPage" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ScheduledMaintenanceState" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "PromoCode" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ProjectSSO" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ProjectCallSMSConfig" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ProbeOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ProbeOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "restrictionTimes" SET DEFAULT '{"_type": "RestrictionTimes", "value": {"restictionType": "None", "dayRestrictionTimes": null, "weeklyRestrictionTimes": []}}'`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "rotation" SET DEFAULT '{"_type": "Recurring", "value": {"intervalType": "Day", "intervalCount": {"_type": "PositiveNumber", "value": 1}}}'`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyScheduleLayer" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyExecutionLogTimeline" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyExecutionLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRuleSchedule" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicySchedule" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyEscalationRule" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicyCustomField" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorStatusTimeline" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorSecret" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorProbe" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorGroupResource" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorGroupOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorGroupOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorGroup" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorCustomField" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentTemplateOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentTemplateOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentTemplate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentStateTimeline" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentPublicNote" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentOwnerUser" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentOwnerTeam" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Team" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentNoteTemplate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentInternalNote" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentCustomField" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Incident" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Probe" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "OnCallDutyPolicy" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Monitor" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "MonitorStatus" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentState" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "IncidentSeverity" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "GreenlockChallenge" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "GreenlockCertificate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "GlobalConfig" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "EmailVerificationToken" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "EmailLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ProjectSMTPConfig" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Domain" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "DataMigrations" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "CopilotAction" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "CopilotPullRequest" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCopilotCodeRepository" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ServiceCatalog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "CopilotCodeRepository" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "CallLog" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "BillingPaymentMethod" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "BillingInvoice" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ApiKeyPermission" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Label" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ApiKey" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Project" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "ResellerPlan" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "Reseller" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "AcmeChallenge" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "AcmeCertificate" ALTER COLUMN "deletedAt" SET DEFAULT now()`); - await queryRunner.query(`ALTER TABLE "User" DROP COLUMN "updatedAt"`); - await queryRunner.query(`ALTER TABLE "User" ADD "updatedAt" TIMESTAMP NOT NULL DEFAULT now()`); - } - -}