This repository was archived by the owner on Sep 17, 2024. It is now read-only.
File tree 4 files changed +49
-10
lines changed
4 files changed +49
-10
lines changed Original file line number Diff line number Diff line change
1
+ -- Add timescale
2
+ CREATE EXTENSION IF NOT EXISTS timescaledb CASCADE;
3
+
4
+ -- CreateTable
5
+ CREATE TABLE "event " (
6
+ " id" UUID NOT NULL ,
7
+ " timestamp" TIMESTAMPTZ NOT NULL ,
8
+ " name" TEXT NOT NULL ,
9
+ " metadata" JSONB
10
+ );
11
+
12
+ -- CreateIndex
13
+ CREATE UNIQUE INDEX "event_id_key " ON " event" (" id" );
14
+
15
+ -- CreateIndex
16
+ CREATE INDEX "event_name_time_idx " ON " event" (" name" , " timestamp" DESC );
Original file line number Diff line number Diff line change
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (i.e. Git)
3
+ provider = " postgresql"
Original file line number Diff line number Diff line change
1
+ datasource db {
2
+ provider = " postgresql "
3
+ url = env (" DATABASE_URL " )
4
+
5
+ }
6
+
7
+ model Event {
8
+ id String @db.Uuid @default (uuid () ) @unique
9
+ timestamp DateTime @db.Timestamptz
10
+ name String
11
+ metadata Json ?
12
+
13
+ // in the init migration, we add the timescale extension and call create_hypertable().
14
+
15
+ @@index (fields : [name , timestamp (sort : Desc ) ] , map : " event_name_time_idx " )
16
+ @@map (" event " )
17
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " Analytics" ,
3
- "description" : " Track and visualize user behavior data. (Coming mid-2024)" ,
4
- "icon" : " chart-line" ,
5
- "tags" : [
6
- " game"
7
- ],
8
- "authors" : [],
9
- "status" : " coming_soon" ,
10
- "scripts" : {},
11
- "errors" : {}
2
+ "status" : " stable" ,
3
+ "name" : " Analytics" ,
4
+ "description" : " Track and visualize user behavior data" ,
5
+ "icon" : " chart-line" ,
6
+ "tags" : [],
7
+ "authors" : [
8
+ " rivet-gg" ,
9
+ " ABCxFF"
10
+ ],
11
+ "scripts" : {
12
+ },
13
+ "errors" : {},
14
+ "dependencies" : {}
12
15
}
You can’t perform that action at this time.
0 commit comments