olros/stats

Database-struktur

Closed this issue · 2 comments

olros commented

image

https://www.prisma.io/docs/guides/database/using-prisma-with-planetscale
https://planetscale.com/docs/tutorials/prisma-quickstart
https://planetscale.com/docs/tutorials/automatic-prisma-migrations

interface PageView {
  project: Project;
  date: DateTime;
  page_title: string;
  pathname: string;
  screen_width: number;
  hashed_user_ip: string;
}

interface Event {
  project: Project;
  name: string;
  date: Date;
  hour: number;
  count: number;
}

olros commented
interface PageView {
  project: Project; // pk
  date: DateTime; // pk
  hour: number; // pk
  pathname: string; // pk

  count: number;
  mobile_count: number;
  desktop_count: number;
}

interface PageVisitor {
  project: Project; // pk
  date: DateTime; // pk
  hashed_user_ip: string; // pk

  count: number;
}

interface Event {
  project: Project; // pk
  name: string; // pk
  date: Date; // pk
  hour: number; // pk

  count: number;
}
olros commented
interface BaseEvent {
  project: Project; // pk
  date: DateTime; // pk
  hour: number; // pk
}

interface PageView {
  baseEvent: BaseEvent; // pk
  pathname: string; // pk

  count: number;
  mobile_count: number;
  desktop_count: number;
}

interface PageVisitor {
  baseEvent: BaseEvent; // pk
  hashed_user_ip: string; // pk

  count: number;
}

interface CustomEvent {
  baseEvent: BaseEvent; // pk
  name: string; // pk

  count: number;
}