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!

remove obsolete migrations

Blue Mouse1a32cb6bbd81
diff --git a/backend/migrations/clickhouse/selfhosted_2025_11_30_salt_rotation.js b/backend/migrations/clickhouse/selfhosted_2025_11_30_salt_rotation.js
deleted file mode 100644
index 27e55bad1..000000000
--- a/backend/migrations/clickhouse/selfhosted_2025_11_30_salt_rotation.js
+++ /dev/null
@@ -1,8 +0,0 @@
-// This migration adds the saltRotation column to the project table for self-hosted instances
-const { queriesRunner, dbName } = require('./setup')
-
-const queries = [
- `ALTER TABLE ${dbName}.project ADD COLUMN IF NOT EXISTS saltRotation String DEFAULT 'daily';`,
-]
-
-queriesRunner(queries)
diff --git a/backend/migrations/clickhouse/selfhosted_2025_12_02_profile_id.js b/backend/migrations/clickhouse/selfhosted_2025_12_02_profile_id.js
deleted file mode 100644
index 981c7d1ed..000000000
--- a/backend/migrations/clickhouse/selfhosted_2025_12_02_profile_id.js
+++ /dev/null
@@ -1,48 +0,0 @@
-const { queriesRunner, dbName } = require('./setup')
-
-const queries = [
- // Add profileId column to analytics table
- `ALTER TABLE ${dbName}.analytics ADD COLUMN IF NOT EXISTS profileId Nullable(String) AFTER psid`,
-
- // Add profileId column to customEV table
- `ALTER TABLE ${dbName}.customEV ADD COLUMN IF NOT EXISTS profileId Nullable(String) AFTER psid`,
-
- // Add profileId column to errors table
- `ALTER TABLE ${dbName}.errors ADD COLUMN IF NOT EXISTS profileId Nullable(String) AFTER psid`,
-
- // Create sessions table with ReplacingMergeTree for tracking session state
- // ReplacingMergeTree automatically keeps the latest row by lastSeen for each (pid, psid) pair
- `CREATE TABLE IF NOT EXISTS ${dbName}.sessions
- (
- psid UInt64,
- pid FixedString(12),
- profileId Nullable(String),
- firstSeen DateTime('UTC'),
- lastSeen DateTime('UTC'),
- pageviews UInt32 DEFAULT 1,
- events UInt32 DEFAULT 0
- )
- ENGINE = ReplacingMergeTree(lastSeen)
- ORDER BY (pid, psid)
- PARTITION BY toYYYYMM(firstSeen);`,
-
- // Migrate data from old session_durations table to new sessions table
- // We compute firstSeen as (now - duration) and set lastSeen to now()
- // profileId is null for historical data (will be populated on new events)
- `INSERT INTO ${dbName}.sessions (psid, pid, profileId, firstSeen, lastSeen, pageviews, events)
- SELECT
- psid,
- pid,
- NULL as profileId,
- subtractSeconds(now(), duration) as firstSeen,
- now() as lastSeen,
- 1 as pageviews,
- 0 as events
- FROM ${dbName}.session_durations
- WHERE (pid, psid) NOT IN (SELECT pid, psid FROM ${dbName}.sessions);`,
-
- // Drop the old session_durations table (commented out for safety - run manually after verifying migration)
- // `DROP TABLE IF EXISTS ${dbName}.session_durations;`,
-]
-
-queriesRunner(queries)
diff --git a/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js b/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js
deleted file mode 100644
index 5d2be7a7b..000000000
--- a/backend/migrations/clickhouse/selfhosted_2025_12_05_remove_salt_rotation.js
+++ /dev/null
@@ -1,9 +0,0 @@
-// This migration removes the saltRotation column from the project table for self-hosted instances
-// Salt rotation is now handled globally and no longer configurable per-project
-const { queriesRunner, dbName } = require('./setup')
-
-const queries = [
- `ALTER TABLE ${dbName}.project DROP COLUMN IF EXISTS saltRotation;`,
-]
-
-queriesRunner(queries)