Skip to content

Commit

Permalink
Add indexes to tables.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecao committed Jul 18, 2020
1 parent 11f1afe commit c681441
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 275 deletions.
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/public/
6 changes: 6 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ model event {
session_id String?
url String
session session? @relation(fields: [session_id], references: [session_id])
@@index([created_at], name: "event_created_at_idx")
}

model pageview {
Expand All @@ -24,6 +26,8 @@ model pageview {
url String
view_id Int @default(autoincrement()) @id
session session? @relation(fields: [session_id], references: [session_id])
@@index([created_at], name: "pageview_created_at_idx")
}

model session {
Expand All @@ -38,6 +42,8 @@ model session {
website website? @relation(fields: [website_id], references: [website_id])
event event[]
pageview pageview[]
@@index([created_at], name: "session_created_at_idx")
}

model website {
Expand Down
275 changes: 1 addition & 274 deletions public/umami.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion sql/schema.sql → sql/schema.postgresql.sql
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,8 @@ create table event (
url varchar(500) not null,
event_type varchar(50) not null,
event_value varchar(255) not null
);
);

create index on session(created_at);
create index on pageview(created_at);
create index on event(created_at);

0 comments on commit c681441

Please sign in to comment.