Skip to content

Commit

Permalink
Merge pull request umami-software#2684 from umami-software/hotfix2
Browse files Browse the repository at this point in the history
v2.11.2
  • Loading branch information
mikecao authored Apr 17, 2024
2 parents be7f69f + 2a43d0b commit a38baa5
Show file tree
Hide file tree
Showing 128 changed files with 4,081 additions and 631 deletions.
57 changes: 57 additions & 0 deletions db/clickhouse/migrations/03_session_data.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
CREATE TABLE umami.event_data_new
(
website_id UUID,
session_id UUID,
event_id UUID,
url_path String,
event_name String,
data_key String,
string_value Nullable(String),
number_value Nullable(Decimal64(4)),
date_value Nullable(DateTime('UTC')),
data_type UInt32,
created_at DateTime('UTC'),
job_id Nullable(UUID)
)
engine = MergeTree
ORDER BY (website_id, event_id, data_key, created_at)
SETTINGS index_granularity = 8192;

INSERT INTO umami.event_data_new
SELECT website_id,
session_id,
event_id,
url_path,
event_name,
event_key,
string_value,
number_value,
date_value,
data_type,
created_at,
NULL
FROM umami.event_data;

CREATE TABLE umami.session_data
(
website_id UUID,
session_id UUID,
data_key String,
string_value Nullable(String),
number_value Nullable(Decimal64(4)),
date_value Nullable(DateTime('UTC')),
data_type UInt32,
created_at DateTime('UTC'),
job_id Nullable(UUID)
)
engine = MergeTree
ORDER BY (website_id, session_id, data_key, created_at)
SETTINGS index_granularity = 8192;

RENAME TABLE umami.event_data TO umami.event_data_old;
RENAME TABLE umami.event_data_new TO umami.event_data;

/*
DROP TABLE umami.event_data_old
*/

26 changes: 21 additions & 5 deletions db/clickhouse/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ CREATE TABLE umami.website_event
event_type UInt32,
event_name String,
created_at DateTime('UTC'),
job_id UUID
job_id Nullable(UUID)
)
engine = MergeTree
ORDER BY (website_id, session_id, created_at)
Expand All @@ -40,14 +40,30 @@ CREATE TABLE umami.event_data
event_id UUID,
url_path String,
event_name String,
event_key String,
data_key String,
string_value Nullable(String),
number_value Nullable(Decimal64(4)), --922337203685477.5625
number_value Nullable(Decimal64(4)),
date_value Nullable(DateTime('UTC')),
data_type UInt32,
created_at DateTime('UTC'),
job_id UUID
job_id Nullable(UUID)
)
engine = MergeTree
ORDER BY (website_id, event_id, event_key, created_at)
ORDER BY (website_id, event_id, data_key, created_at)
SETTINGS index_granularity = 8192;

CREATE TABLE umami.session_data
(
website_id UUID,
session_id UUID,
data_key String,
string_value Nullable(String),
number_value Nullable(Decimal64(4)),
date_value Nullable(DateTime('UTC')),
data_type UInt32,
created_at DateTime('UTC'),
job_id Nullable(UUID)
)
engine = MergeTree
ORDER BY (website_id, session_id, data_key, created_at)
SETTINGS index_granularity = 8192;
20 changes: 20 additions & 0 deletions db/mysql/migrations/06_session_data/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-- DropIndex
DROP INDEX `event_data_website_id_created_at_event_key_idx` ON `event_data`;

-- DropIndex
DROP INDEX `event_data_website_id_website_event_id_created_at_idx` ON `event_data`;

-- AlterTable
ALTER TABLE `event_data` RENAME COLUMN `event_key` TO `data_key`;

-- AlterTable
ALTER TABLE `session_data` RENAME COLUMN `event_key` TO `data_key`;

-- CreateIndex
CREATE INDEX `event_data_website_id_created_at_data_key_idx` ON `event_data`(`website_id`, `created_at`, `data_key`);

-- CreateIndex
CREATE INDEX `session_data_session_id_created_at_idx` ON `session_data`(`session_id`, `created_at`);

-- CreateIndex
CREATE INDEX `session_data_website_id_created_at_data_key_idx` ON `session_data`(`website_id`, `created_at`, `data_key`);
9 changes: 5 additions & 4 deletions db/mysql/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ model EventData {
id String @id() @map("event_data_id") @db.VarChar(36)
websiteId String @map("website_id") @db.VarChar(36)
websiteEventId String @map("website_event_id") @db.VarChar(36)
eventKey String @map("event_key") @db.VarChar(500)
dataKey String @map("data_key") @db.VarChar(500)
stringValue String? @map("string_value") @db.VarChar(500)
numberValue Decimal? @map("number_value") @db.Decimal(19, 4)
dateValue DateTime? @map("date_value") @db.Timestamp(0)
Expand All @@ -138,17 +138,16 @@ model EventData {
@@index([createdAt])
@@index([websiteId])
@@index([websiteEventId])
@@index([websiteId, websiteEventId, createdAt])
@@index([websiteId, createdAt])
@@index([websiteId, createdAt, eventKey])
@@index([websiteId, createdAt, dataKey])
@@map("event_data")
}

model SessionData {
id String @id() @map("session_data_id") @db.VarChar(36)
websiteId String @map("website_id") @db.VarChar(36)
sessionId String @map("session_id") @db.VarChar(36)
eventKey String @map("event_key") @db.VarChar(500)
dataKey String @map("data_key") @db.VarChar(500)
stringValue String? @map("string_value") @db.VarChar(500)
numberValue Decimal? @map("number_value") @db.Decimal(19, 4)
dateValue DateTime? @map("date_value") @db.Timestamp(0)
Expand All @@ -161,6 +160,8 @@ model SessionData {
@@index([createdAt])
@@index([websiteId])
@@index([sessionId])
@@index([sessionId, createdAt])
@@index([websiteId, createdAt, dataKey])
@@map("session_data")
}

Expand Down
18 changes: 18 additions & 0 deletions db/postgresql/migrations/06_session_data/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
-- DropIndex
DROP INDEX IF EXISTS "event_data_website_id_created_at_event_key_idx";

-- AlterTable
ALTER TABLE "event_data" RENAME COLUMN "event_key" TO "data_key";

-- AlterTable
ALTER TABLE "session_data" DROP COLUMN "deleted_at";
ALTER TABLE "session_data" RENAME COLUMN "session_key" TO "data_key";

-- CreateIndex
CREATE INDEX "event_data_website_id_created_at_data_key_idx" ON "event_data"("website_id", "created_at", "data_key");

-- CreateIndex
CREATE INDEX "session_data_session_id_created_at_idx" ON "session_data"("session_id", "created_at");

-- CreateIndex
CREATE INDEX "session_data_website_id_created_at_data_key_idx" ON "session_data"("website_id", "created_at", "data_key");
9 changes: 5 additions & 4 deletions db/postgresql/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ model EventData {
id String @id() @map("event_data_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
websiteEventId String @map("website_event_id") @db.Uuid
eventKey String @map("event_key") @db.VarChar(500)
dataKey String @map("data_key") @db.VarChar(500)
stringValue String? @map("string_value") @db.VarChar(500)
numberValue Decimal? @map("number_value") @db.Decimal(19, 4)
dateValue DateTime? @map("date_value") @db.Timestamptz(6)
Expand All @@ -139,28 +139,29 @@ model EventData {
@@index([websiteId])
@@index([websiteEventId])
@@index([websiteId, createdAt])
@@index([websiteId, createdAt, eventKey])
@@index([websiteId, createdAt, dataKey])
@@map("event_data")
}

model SessionData {
id String @id() @map("session_data_id") @db.Uuid
websiteId String @map("website_id") @db.Uuid
sessionId String @map("session_id") @db.Uuid
sessionKey String @map("session_key") @db.VarChar(500)
dataKey String @map("data_key") @db.VarChar(500)
stringValue String? @map("string_value") @db.VarChar(500)
numberValue Decimal? @map("number_value") @db.Decimal(19, 4)
dateValue DateTime? @map("date_value") @db.Timestamptz(6)
dataType Int @map("data_type") @db.Integer
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
deletedAt DateTime? @default(now()) @map("deleted_at") @db.Timestamptz(6)
website Website @relation(fields: [websiteId], references: [id])
session Session @relation(fields: [sessionId], references: [id])
@@index([createdAt])
@@index([websiteId])
@@index([sessionId])
@@index([sessionId, createdAt])
@@index([websiteId, createdAt, dataKey])
@@map("session_data")
}

Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "umami",
"version": "2.11.1",
"version": "2.11.2",
"description": "A simple, fast, privacy-focused alternative to Google Analytics.",
"author": "Umami Software, Inc. <[email protected]>",
"license": "MIT",
Expand Down Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"@clickhouse/client": "^0.2.2",
"@fontsource/inter": "^4.5.15",
"@prisma/client": "5.11.0",
"@prisma/client": "5.12.1",
"@prisma/extension-read-replicas": "^0.3.0",
"@react-spring/web": "^9.7.3",
"@tanstack/react-query": "^5.28.6",
Expand Down Expand Up @@ -102,7 +102,7 @@
"next-basics": "^0.39.0",
"node-fetch": "^3.2.8",
"npm-run-all": "^4.1.5",
"prisma": "5.11.0",
"prisma": "5.12.1",
"react": "^18.2.0",
"react-basics": "^0.123.0",
"react-beautiful-dnd": "^13.1.0",
Expand Down
56 changes: 56 additions & 0 deletions public/intl/messages/am-ET.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@
"value": "Add member"
}
],
"label.add-step": [
{
"type": 0,
"value": "Add step"
}
],
"label.add-website": [
{
"type": 0,
Expand Down Expand Up @@ -555,6 +561,20 @@
"value": " hours"
}
],
"label.last-months": [
{
"type": 0,
"value": "Last "
},
{
"type": 1,
"value": "x"
},
{
"type": 0,
"value": " months"
}
],
"label.leave": [
{
"type": 0,
Expand Down Expand Up @@ -965,6 +985,12 @@
"value": "Single day"
}
],
"label.steps": [
{
"type": 0,
"value": "Steps"
}
],
"label.sum": [
{
"type": 0,
Expand Down Expand Up @@ -1139,6 +1165,12 @@
"value": "Untitled"
}
],
"label.update": [
{
"type": 0,
"value": "Update"
}
],
"label.url": [
{
"type": 0,
Expand Down Expand Up @@ -1169,6 +1201,18 @@
"value": "Users"
}
],
"label.utm": [
{
"type": 0,
"value": "UTM"
}
],
"label.utm-description": [
{
"type": 0,
"value": "Track your campaigns through UTM parameters."
}
],
"label.value": [
{
"type": 0,
Expand Down Expand Up @@ -1199,12 +1243,24 @@
"value": "Views"
}
],
"label.views-per-visit": [
{
"type": 0,
"value": "Views per visit"
}
],
"label.visitors": [
{
"type": 0,
"value": "Visitors"
}
],
"label.visits": [
{
"type": 0,
"value": "Visits"
}
],
"label.website": [
{
"type": 0,
Expand Down
Loading

0 comments on commit a38baa5

Please sign in to comment.