Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v2.14.0 #3061

Merged
merged 117 commits into from
Nov 21, 2024
Merged

v2.14.0 #3061

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
117 commits
Select commit Hold shift + click to select a range
d80739a
Remove `locale.css`
quiple Aug 28, 2024
d7734d0
Remove className locale
quiple Aug 28, 2024
13c7dd6
add cascading delete to sessionData
franciscao633 Aug 28, 2024
8f786d6
Increase consistency of German translation on Events screen
konstantintutsch Aug 28, 2024
4ecd2af
Added build for cloud.
mikecao Aug 28, 2024
c6e4cf7
Merge remote-tracking branch 'origin/dev' into dev
mikecao Aug 28, 2024
2de8632
Updated cloud build.
mikecao Aug 28, 2024
bd72868
Update RealtimeCountries.tsx
quiple Aug 28, 2024
01fc293
Merge remote-tracking branch 'upstream/master' into fix-font-family
quiple Aug 29, 2024
330f3e2
Update ko-KR.json
quiple Aug 29, 2024
bfe15e9
Push cloud image to docker.io instead.
mikecao Sep 3, 2024
2d21260
feat: major and minor tags on docker build
Quadrubo Sep 4, 2024
f2f77a0
Update ru-RU.json
xuserz Sep 5, 2024
5d8a3a9
move event stats to event-data folder
franciscao633 Sep 9, 2024
45f93eb
move event stats to event-data folder
franciscao633 Sep 9, 2024
f05e926
Updated telemetry payload.
mikecao Sep 10, 2024
88fe98c
Merge remote-tracking branch 'origin/dev' into dev
mikecao Sep 10, 2024
29044de
Add sessionData label
franciscao633 Sep 12, 2024
e440779
add getEventDataFields
franciscao633 Sep 13, 2024
fa3710b
add getEventDataFields
franciscao633 Sep 13, 2024
517da90
Add `Access-Control-Allow-Origin` header with value `*` to tracker sc…
peter-kuhmann Sep 16, 2024
fcb7fa2
fix reset website bug
franciscao633 Sep 18, 2024
61280e7
Merge branch 'analytics' of https://github.com/umami-software/umami i…
franciscao633 Sep 18, 2024
60cd869
Merge branch 'master' into dev
mikecao Sep 18, 2024
d4da5ae
fix 'none' as hostname when 'data:' URLs
yArna Sep 18, 2024
be656f0
fix tracker localStorage DOMException in data URLs
yArna Sep 18, 2024
e173f37
remove northern cyprus from datamaps
franciscao633 Sep 18, 2024
438eb4b
remove northern cyprus from datamaps
franciscao633 Sep 18, 2024
8fef99b
fix: use the same id for event and event data for clickhouse
Sep 20, 2024
659cfb4
bugfix: events count amend
Sep 25, 2024
e7ffcbd
Bump rollup from 3.29.4 to 3.29.5
dependabot[bot] Sep 26, 2024
2707b39
v1 revenue report for clickhouse
franciscao633 Sep 26, 2024
214396f
Merge pull request #2981 from pinkli/master
mikecao Sep 26, 2024
2cd38f1
Moved files around.
mikecao Sep 26, 2024
85ce032
Merge branch 'dev' of https://github.com/umami-software/umami into dev
mikecao Sep 26, 2024
be50e8a
add dropdown logic for revenue report, defaults to USD for unknown cu…
franciscao633 Sep 27, 2024
6a0e88c
Merge branch 'dev' of https://github.com/umami-software/umami into dev
mikecao Oct 1, 2024
af06f65
Merge pull request #2947 from quiple/ko-kr
mikecao Oct 4, 2024
9e2c8bc
Merge branch 'dev' of https://github.com/umami-software/umami into dev
mikecao Oct 4, 2024
430880c
Updated lang.
mikecao Oct 4, 2024
20b6410
Fixed import.
mikecao Oct 5, 2024
7de52d6
Merge pull request #2971 from yArna/master
mikecao Oct 5, 2024
ba078a1
Fix singular of Event in German translation
Brawl345 Oct 6, 2024
1a2ae43
Fix revenue report bugs
franciscao633 Oct 9, 2024
801200c
Fixed tracker.
mikecao Oct 9, 2024
9d0da45
Merge remote-tracking branch 'origin/dev' into dev
mikecao Oct 9, 2024
d3c4dc4
Update cs-CZ.json
fra-iesus Oct 12, 2024
065499a
update avg aggregate for revenue report
franciscao633 Oct 15, 2024
6ce9a8c
add currency attribute to revenue button
franciscao633 Oct 15, 2024
bffb98c
add tag migrations and update send / saveEvent
franciscao633 Oct 15, 2024
8759ba9
add tags table and filters logic
franciscao633 Oct 15, 2024
8a59bb0
Changed tracker script name.
mikecao Oct 16, 2024
a708e6c
add tags to ch schema file
franciscao633 Oct 17, 2024
9a5d18f
Merge branch 'analytics' of https://github.com/umami-software/umami i…
franciscao633 Oct 17, 2024
da47dce
fix hardcoded currency query
franciscao633 Oct 21, 2024
3998826
Merge pull request #2984 from umami-software/dependabot/npm_and_yarn/…
mikecao Oct 25, 2024
451da3a
Merge pull request #3004 from fra-iesus/patch-1
mikecao Oct 25, 2024
a282b7d
Merge pull request #2923 from konstantintutsch/dev
mikecao Oct 25, 2024
c78fd24
Merge pull request #2951 from xuserz/patch-1
mikecao Oct 25, 2024
9ad9f7c
Merge pull request #2944 from Quadrubo/feat/major-minor-tags-on-docke…
mikecao Oct 25, 2024
2ed22f8
Merge pull request #2919 from quiple/fix-font-family
mikecao Oct 25, 2024
d1436d4
fix: added underscore support (#1)
ZerGo0 Oct 25, 2024
7bf1f95
chore: removed pnpm-loc.yaml
ZerGo0 Oct 25, 2024
1384a73
edited de-CH
rafaelschranz Oct 26, 2024
fc1b70f
Merge pull request #3027 from rafaelschranz/translation
mikecao Oct 26, 2024
b2a1b17
Merge pull request #2974 from dineshsalunke/fix/clickhouse-event-rela…
mikecao Oct 26, 2024
fec0701
Merge branch 'dev' into add-cors-header-for-tracker-script
mikecao Oct 26, 2024
1f52b49
Merge pull request #2965 from peter-kuhmann/add-cors-header-for-track…
mikecao Oct 26, 2024
586d223
Updated lang files.
mikecao Oct 26, 2024
3fb68e1
feat: Add support for hash-based routing tracking
DDDDD12138 Oct 28, 2024
9758b55
Merge pull request #2960 from DDDDD12138/feat-support-hash-route
mikecao Oct 29, 2024
1225473
Added TRACKER_SCRIPT_URL env var.
mikecao Oct 29, 2024
1d4f1a8
Set engine to InnoDB for MySQL
Nov 1, 2024
92bbaf7
Upgrade Netlify Next.js plugin
ruchernchong Nov 1, 2024
ae25be6
Update translations for ro-RO
Nov 1, 2024
d031f80
Improve translation
Nov 1, 2024
68c68f9
Update fr-FR.json
SigmazZ Nov 5, 2024
bc2f8bc
redirects to last selected team on login
chelsey-g Nov 6, 2024
16f5639
Merge pull request #3038 from sgcarstrends/master
mikecao Nov 8, 2024
b81f368
Merge pull request #3042 from SigmazZ/patch-1
mikecao Nov 8, 2024
a0780d6
Merge pull request #3036 from tudormarze/fix/translations-ro
mikecao Nov 8, 2024
f84d896
Merge pull request #3035 from tudormarze/fix/mysql-myisam
mikecao Nov 8, 2024
88b0e62
add Cache-Control headers to tracking script
michaelpayne02 Nov 8, 2024
378ba45
Updated tracker docker script.
mikecao Nov 9, 2024
1c98876
Merge branch 'dev' of https://github.com/umami-software/umami into dev
mikecao Nov 9, 2024
fe98d6c
Updated lang files.
mikecao Nov 9, 2024
65c4627
add active website tracking with pin icon
chelsey-g Nov 11, 2024
ac302c9
replaces cookies with localStorage
chelsey-g Nov 11, 2024
c50b0c9
updated localStorage to next-basics
chelsey-g Nov 11, 2024
1a5ae45
Updated packages.
mikecao Nov 12, 2024
8d63d23
loads all websites in order to edit them
chelsey-g Nov 15, 2024
3decad5
use params
mooxl Nov 16, 2024
8b676c6
respect expanded view
mooxl Nov 16, 2024
7e6e79c
cleanup
mooxl Nov 16, 2024
6d6a3d4
add z-index
mooxl Nov 17, 2024
bebe15d
Merge pull request #3057 from chelsey-g/load-all-websites-edit
mikecao Nov 18, 2024
884f197
Merge pull request #3055 from mooxl/add-zindex-to-dropdown-menu
mikecao Nov 18, 2024
22c8924
Merge pull request #3053 from mooxl/respect-filter-in-usewebsitemetric
mikecao Nov 18, 2024
e32d2b9
Merge branch 'dev' into master
mikecao Nov 18, 2024
327b2c8
Merge pull request #3046 from michaelpayne02/master
mikecao Nov 18, 2024
0d561eb
Merge pull request #3043 from chelsey-g/team-cookie
mikecao Nov 18, 2024
964632f
Merge pull request #3024 from ZerGo0/master
mikecao Nov 18, 2024
65d09a5
Merge branch 'dev' into dash-inactive
mikecao Nov 18, 2024
8dc4ffe
Merge pull request #3049 from chelsey-g/dash-inactive
mikecao Nov 18, 2024
fb0ff24
Fixed headers.
mikecao Nov 18, 2024
03b2ca4
Merge branch 'master' into dev
mikecao Nov 18, 2024
2729538
Updated packages.
mikecao Nov 18, 2024
70f919b
Use `unknown` label for `undefined` countries
eremannisto Nov 19, 2024
ec2f520
update pinned ui. remove paging if dashboard edited
franciscao633 Nov 19, 2024
cd72fca
Merge pull request #3060 from eremannisto/improve-handling-of-undefin…
mikecao Nov 20, 2024
6ed660d
Fixed referrer check. Closes #3016.
mikecao Nov 20, 2024
4de8840
Code cleanup.
mikecao Nov 21, 2024
9c2bfe8
Revert to script.js.
mikecao Nov 21, 2024
b8a2b07
Updated packages.
mikecao Nov 21, 2024
7803f72
Removed team redirect for cloud mode.
mikecao Nov 21, 2024
bb7e8fd
Merge remote-tracking branch 'origin/analytics' into analytics
mikecao Nov 21, 2024
620a838
Updated dashboard edit.
mikecao Nov 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions .github/workflows/cd-cloud.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Create docker images

on:
push:
branches:
- analytics

jobs:
build:
name: Build, push, and deploy
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Generate random hash
id: random_hash
run: echo "hash=$(openssl rand -hex 4)" >> $GITHUB_OUTPUT

- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to docker.io
with:
image: umamisoftware/umami
tags: cloud-${{ steps.random_hash.outputs.hash }}, cloud-latest
buildArgs: DATABASE_TYPE=postgresql
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
19 changes: 17 additions & 2 deletions .github/workflows/cd-manual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,26 @@ jobs:
steps:
- uses: actions/checkout@v3

- name: Extract version parts from input
id: extract_version
run: |
echo "version=$(echo ${{ github.event.inputs.version }})" >> $GITHUB_ENV
echo "major=$(echo ${{ github.event.inputs.version }} | cut -d. -f1)" >> $GITHUB_ENV
echo "minor=$(echo ${{ github.event.inputs.version }} | cut -d. -f2)" >> $GITHUB_ENV
- name: Generate tags
id: generate_tags
run: |
echo "tag_major=$(echo ${{ matrix.db-type }}-${{ env.major }})" >> $GITHUB_ENV
echo "tag_minor=$(echo ${{ matrix.db-type }}-${{ env.major }}.${{ env.minor }})" >> $GITHUB_ENV
echo "tag_patch=$(echo ${{ matrix.db-type }}-${{ env.version }})" >> $GITHUB_ENV
echo "tag_latest=$(echo ${{ matrix.db-type }}-latest)" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }}
with:
image: umami
tags: ${{ matrix.db-type }}-${{ inputs.version }}, ${{ matrix.db-type }}-latest
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: ghcr.io
multiPlatform: true
Expand All @@ -36,7 +51,7 @@ jobs:
name: Build & push Docker image to docker.io for ${{ matrix.db-type }}
with:
image: umamisoftware/umami
tags: ${{ matrix.db-type }}-${{ inputs.version }}, ${{ matrix.db-type }}-latest
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,33 @@ jobs:

- name: Set env
run: |
echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
echo "NOW=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" >> $GITHUB_ENV
- name: Generate tags
id: generate_tags
run: |
echo "tag_patch=$(echo ${{ matrix.db-type }})-${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV
echo "tag_minor=$(echo ${{ matrix.db-type }})-$(echo ${GITHUB_REF#refs/tags/} | cut -d. -f1,2)" >> $GITHUB_ENV
echo "tag_major=$(echo ${{ matrix.db-type }})-$(echo ${GITHUB_REF#refs/tags/} | cut -d. -f1)" >> $GITHUB_ENV
echo "tag_latest=$(echo ${{ matrix.db-type }})-latest" >> $GITHUB_ENV
- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to ghcr.io for ${{ matrix.db-type }}
with:
image: umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: ghcr.io
multiPlatform: true
platform: linux/amd64,linux/arm64
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}


- uses: mr-smithers-excellent/docker-build-push@v6
name: Build & push Docker image to docker.io for ${{ matrix.db-type }}
with:
image: umamisoftware/umami
tags: ${{ matrix.db-type }}-${{ env.RELEASE_VERSION }}, ${{ matrix.db-type }}-latest
tags: ${{ env.tag_major }}, ${{ env.tag_minor }}, ${{ env.tag_patch }}, ${{ env.tag_latest }}
buildArgs: DATABASE_TYPE=${{ matrix.db-type }}
registry: docker.io
username: ${{ secrets.DOCKER_USERNAME }}
Expand Down
77 changes: 77 additions & 0 deletions db/clickhouse/migrations/04_add_tag.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
-- add tag column
ALTER TABLE umami.website_event ADD COLUMN "tag" String AFTER "event_name";
ALTER TABLE umami.website_event_stats_hourly ADD COLUMN "tag" SimpleAggregateFunction(groupArrayArray, Array(String)) AFTER "max_time";

-- update materialized view
DROP TABLE umami.website_event_stats_hourly_mv;

CREATE MATERIALIZED VIEW umami.website_event_stats_hourly_mv
TO umami.website_event_stats_hourly
AS
SELECT
website_id,
session_id,
visit_id,
hostname,
browser,
os,
device,
screen,
language,
country,
subdivision1,
city,
entry_url,
exit_url,
url_paths as url_path,
url_query,
referrer_domain,
page_title,
event_type,
event_name,
views,
min_time,
max_time,
tag,
timestamp as created_at
FROM (SELECT
website_id,
session_id,
visit_id,
hostname,
browser,
os,
device,
screen,
language,
country,
subdivision1,
city,
argMinState(url_path, created_at) entry_url,
argMaxState(url_path, created_at) exit_url,
arrayFilter(x -> x != '', groupArray(url_path)) as url_paths,
arrayFilter(x -> x != '', groupArray(url_query)) url_query,
arrayFilter(x -> x != '', groupArray(referrer_domain)) referrer_domain,
arrayFilter(x -> x != '', groupArray(page_title)) page_title,
event_type,
if(event_type = 2, groupArray(event_name), []) event_name,
sumIf(1, event_type = 1) views,
min(created_at) min_time,
max(created_at) max_time,
arrayFilter(x -> x != '', groupArray(tag)) tag,
toStartOfHour(created_at) timestamp
FROM umami.website_event
GROUP BY website_id,
session_id,
visit_id,
hostname,
browser,
os,
device,
screen,
language,
country,
subdivision1,
city,
event_type,
timestamp);
4 changes: 4 additions & 0 deletions db/clickhouse/schema.sql
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ CREATE TABLE umami.website_event
--events
event_type UInt32,
event_name String,
tag String,
created_at DateTime('UTC'),
job_id Nullable(UUID)
)
Expand Down Expand Up @@ -96,6 +97,7 @@ CREATE TABLE umami.website_event_stats_hourly
views SimpleAggregateFunction(sum, UInt64),
min_time SimpleAggregateFunction(min, DateTime('UTC')),
max_time SimpleAggregateFunction(max, DateTime('UTC')),
tag SimpleAggregateFunction(groupArrayArray, Array(String)),
created_at Datetime('UTC')
)
ENGINE = AggregatingMergeTree
Expand Down Expand Up @@ -136,6 +138,7 @@ SELECT
views,
min_time,
max_time,
tag,
timestamp as created_at
FROM (SELECT
website_id,
Expand All @@ -161,6 +164,7 @@ FROM (SELECT
sumIf(1, event_type = 1) views,
min(created_at) min_time,
max(created_at) max_time,
arrayFilter(x -> x != '', groupArray(tag)) tag,
toStartOfHour(created_at) timestamp
FROM umami.website_event
GROUP BY website_id,
Expand Down
16 changes: 8 additions & 8 deletions db/mysql/migrations/01_init/migration.sql
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ CREATE TABLE `user` (
UNIQUE INDEX `user_user_id_key`(`user_id`),
UNIQUE INDEX `user_username_key`(`username`),
PRIMARY KEY (`user_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `session` (
Expand All @@ -33,7 +33,7 @@ CREATE TABLE `session` (
INDEX `session_created_at_idx`(`created_at`),
INDEX `session_website_id_idx`(`website_id`),
PRIMARY KEY (`session_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `website` (
Expand All @@ -53,7 +53,7 @@ CREATE TABLE `website` (
INDEX `website_created_at_idx`(`created_at`),
INDEX `website_share_id_idx`(`share_id`),
PRIMARY KEY (`website_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `website_event` (
Expand All @@ -76,7 +76,7 @@ CREATE TABLE `website_event` (
INDEX `website_event_website_id_created_at_idx`(`website_id`, `created_at`),
INDEX `website_event_website_id_session_id_created_at_idx`(`website_id`, `session_id`, `created_at`),
PRIMARY KEY (`event_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `event_data` (
Expand All @@ -95,7 +95,7 @@ CREATE TABLE `event_data` (
INDEX `event_data_website_event_id_idx`(`website_event_id`),
INDEX `event_data_website_id_website_event_id_created_at_idx`(`website_id`, `website_event_id`, `created_at`),
PRIMARY KEY (`event_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `team` (
Expand All @@ -109,7 +109,7 @@ CREATE TABLE `team` (
UNIQUE INDEX `team_access_code_key`(`access_code`),
INDEX `team_access_code_idx`(`access_code`),
PRIMARY KEY (`team_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `team_user` (
Expand All @@ -124,7 +124,7 @@ CREATE TABLE `team_user` (
INDEX `team_user_team_id_idx`(`team_id`),
INDEX `team_user_user_id_idx`(`user_id`),
PRIMARY KEY (`team_user_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `team_website` (
Expand All @@ -137,7 +137,7 @@ CREATE TABLE `team_website` (
INDEX `team_website_team_id_idx`(`team_id`),
INDEX `team_website_website_id_idx`(`website_id`),
PRIMARY KEY (`team_website_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- AddSystemUser
INSERT INTO user (user_id, username, role, password) VALUES ('41e2b680-648e-4b09-bcd7-3e2b10c06264' , 'admin', 'admin', '$2b$10$BUli0c.muyCW1ErNJc3jL.vFRFtFJWrT8/GcR4A.sUdCznaXiqFXa');
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CREATE TABLE `session_data` (
INDEX `session_data_website_id_idx`(`website_id`),
INDEX `session_data_session_id_idx`(`session_id`),
PRIMARY KEY (`session_data_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- CreateTable
CREATE TABLE `report` (
Expand All @@ -41,7 +41,7 @@ CREATE TABLE `report` (
INDEX `report_type_idx`(`type`),
INDEX `report_name_idx`(`name`),
PRIMARY KEY (`report_id`)
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
) ENGINE=InnoDB DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;

-- EventData migration
UPDATE event_data
Expand Down
5 changes: 5 additions & 0 deletions db/mysql/migrations/07_add_tag/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE `website_event` ADD COLUMN `tag` VARCHAR(50) NULL;

-- CreateIndex
CREATE INDEX `website_event_website_id_created_at_tag_idx` ON `website_event`(`website_id`, `created_at`, `tag`);
2 changes: 2 additions & 0 deletions db/mysql/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ model WebsiteEvent {
pageTitle String? @map("page_title") @db.VarChar(500)
eventType Int @default(1) @map("event_type") @db.UnsignedInt
eventName String? @map("event_name") @db.VarChar(50)
tag String? @db.VarChar(50)
eventData EventData[]
session Session @relation(fields: [sessionId], references: [id])
Expand All @@ -116,6 +117,7 @@ model WebsiteEvent {
@@index([websiteId, createdAt, referrerDomain])
@@index([websiteId, createdAt, pageTitle])
@@index([websiteId, createdAt, eventName])
@@index([websiteId, createdAt, tag])
@@index([websiteId, sessionId, createdAt])
@@index([websiteId, visitId, createdAt])
@@map("website_event")
Expand Down
5 changes: 5 additions & 0 deletions db/postgresql/migrations/07_add_tag/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "website_event" ADD COLUMN "tag" VARCHAR(50);

-- CreateIndex
CREATE INDEX "website_event_website_id_created_at_tag_idx" ON "website_event"("website_id", "created_at", "tag");
3 changes: 3 additions & 0 deletions db/postgresql/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ model WebsiteEvent {
pageTitle String? @map("page_title") @db.VarChar(500)
eventType Int @default(1) @map("event_type") @db.Integer
eventName String? @map("event_name") @db.VarChar(50)
tag String? @db.VarChar(50)
eventData EventData[]
session Session @relation(fields: [sessionId], references: [id])
Expand All @@ -111,11 +112,13 @@ model WebsiteEvent {
@@index([visitId])
@@index([websiteId])
@@index([websiteId, createdAt])
@@index([websiteId, createdAt, urlPath])
@@index([websiteId, createdAt, urlQuery])
@@index([websiteId, createdAt, referrerDomain])
@@index([websiteId, createdAt, pageTitle])
@@index([websiteId, createdAt, eventName])
@@index([websiteId, createdAt, tag])
@@index([websiteId, sessionId, createdAt])
@@index([websiteId, visitId, createdAt])
@@map("website_event")
Expand Down
2 changes: 1 addition & 1 deletion next-env.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
/// <reference types="next/navigation-types/compat/navigation" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
// see https://nextjs.org/docs/app/building-your-application/configuring/typescript for more information.
Loading
Loading