Skip to content

📈 Open source, privacy-first web analytics — a cookie-less Google Analytics alternative with built-in error tracking and performance monitoring. Self-host it or use our cloud. Get started for free!

queryMetric - errors migration

Blue Mouse7752e840d917
diff --git a/backend/apps/cloud/src/alert/alert.controller.ts b/backend/apps/cloud/src/alert/alert.controller.ts
index 30f81cfcf..9ead87e43 100644
--- a/backend/apps/cloud/src/alert/alert.controller.ts
+++ b/backend/apps/cloud/src/alert/alert.controller.ts
@@ -211,8 +211,8 @@ export class AlertController {
...newAlert,
pid: alertDTO.pid,
}
- } catch (e) {
- console.error('Error while creating alert', e)
+ } catch (reason) {
+ console.error('Error while creating alert', reason)
throw new BadRequestException('Error occured while creating alert')
}
}
diff --git a/backend/migrations/mysql/2025_05_10.sql b/backend/migrations/mysql/2025_05_10.sql
index babee1504..b41bca0be 100644
--- a/backend/migrations/mysql/2025_05_10.sql
+++ b/backend/migrations/mysql/2025_05_10.sql
@@ -1,5 +1,8 @@
ALTER TABLE alert ADD COLUMN `alert_on_new_errors_only` tinyint NOT NULL DEFAULT '1';
+-- Add errors to the queryMetric enum
+ALTER TABLE alert MODIFY COLUMN `queryMetric` enum('page_views','unique_page_views','online_users','custom_events','errors') DEFAULT NULL AFTER `created`;
+
-- Change lastTriggered from DATE to DATETIME, preserving the date and setting time to 00:00:00
-- Step 1: Add a new temporary DATETIME column
ALTER TABLE alert ADD COLUMN `lastTriggered_temp_dt` DATETIME DEFAULT NULL;