mirror of
https://github.com/kremalicious/umami.git
synced 2025-02-14 21:10:34 +01:00
schema changes to CH, Postgres, MySQL
This commit is contained in:
parent
3823705fc6
commit
9321401297
@ -19,8 +19,11 @@ CREATE TABLE event
|
||||
subdivision2 LowCardinality(String),
|
||||
city String,
|
||||
--pageview
|
||||
url String,
|
||||
referrer String,
|
||||
url_path String,
|
||||
url_query String,
|
||||
referrer_path String,
|
||||
referrer_query String,
|
||||
referrer_domain String,
|
||||
page_title String,
|
||||
--event
|
||||
event_type UInt32,
|
||||
@ -48,8 +51,11 @@ CREATE TABLE event_queue (
|
||||
subdivision2 LowCardinality(String),
|
||||
city String,
|
||||
--pageview
|
||||
url String,
|
||||
referrer String,
|
||||
url_path String,
|
||||
url_query String,
|
||||
referrer_path String,
|
||||
referrer_query String,
|
||||
referrer_domain String,
|
||||
page_title String,
|
||||
--event
|
||||
event_type UInt32,
|
||||
@ -79,8 +85,11 @@ SELECT website_id,
|
||||
subdivision1,
|
||||
subdivision2,
|
||||
city,
|
||||
url,
|
||||
referrer,
|
||||
url_path String,
|
||||
url_query String,
|
||||
referrer_path String,
|
||||
referrer_query String,
|
||||
referrer_domain String,
|
||||
page_title,
|
||||
event_type,
|
||||
event_name,
|
||||
|
@ -61,8 +61,11 @@ CREATE TABLE `website_event` (
|
||||
`website_id` VARCHAR(36) NOT NULL,
|
||||
`session_id` VARCHAR(36) NOT NULL,
|
||||
`created_at` TIMESTAMP(0) NULL DEFAULT CURRENT_TIMESTAMP(0),
|
||||
`url` VARCHAR(500) NOT NULL,
|
||||
`referrer` VARCHAR(500) NULL,
|
||||
`url_path` VARCHAR(500) NOT NULL,
|
||||
`url_query` VARCHAR(500) NULL,
|
||||
`referrer_path` VARCHAR(500) NULL,
|
||||
`referrer_query` VARCHAR(500) NULL,
|
||||
`referrer_domain` VARCHAR(500) NULL,
|
||||
`page_title` VARCHAR(500) NULL,
|
||||
`event_type` INTEGER UNSIGNED NOT NULL DEFAULT 1,
|
||||
`event_name` VARCHAR(50) NULL,
|
||||
|
@ -65,15 +65,18 @@ model Website {
|
||||
}
|
||||
|
||||
model WebsiteEvent {
|
||||
id String @id() @map("event_id") @db.VarChar(36)
|
||||
websiteId String @map("website_id") @db.VarChar(36)
|
||||
sessionId String @map("session_id") @db.VarChar(36)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
url String @db.VarChar(500)
|
||||
referrer String? @db.VarChar(500)
|
||||
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)
|
||||
id String @id() @map("event_id") @db.VarChar(36)
|
||||
websiteId String @map("website_id") @db.VarChar(36)
|
||||
sessionId String @map("session_id") @db.VarChar(36)
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamp(0)
|
||||
urlPath String @map("url_path") @db.VarChar(500)
|
||||
urlQuery String? @map("url_query") @db.VarChar(500)
|
||||
referrerPath String? @map("referrer_path") @db.VarChar(500)
|
||||
referrerQuery String? @map("referrer_query") @db.VarChar(500)
|
||||
referrerDomain String? @map("referrer_domain") @db.VarChar(500)
|
||||
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)
|
||||
|
||||
@@index([createdAt])
|
||||
@@index([sessionId])
|
||||
|
20
db/postgresql/migrations/08_split_url_referrer/migration.sql
Normal file
20
db/postgresql/migrations/08_split_url_referrer/migration.sql
Normal file
@ -0,0 +1,20 @@
|
||||
/*
|
||||
Warnings:
|
||||
|
||||
- You are about to drop the column `userId` on the `team_website` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `referrer` on the `website_event` table. All the data in the column will be lost.
|
||||
- You are about to drop the column `url` on the `website_event` table. All the data in the column will be lost.
|
||||
- Added the required column `url_path` to the `website_event` table without a default value. This is not possible if the table is not empty.
|
||||
|
||||
*/
|
||||
-- AlterTable
|
||||
ALTER TABLE "team_website" DROP COLUMN "userId";
|
||||
|
||||
-- AlterTable
|
||||
ALTER TABLE "website_event" DROP COLUMN "referrer",
|
||||
DROP COLUMN "url",
|
||||
ADD COLUMN "referrer_domain" VARCHAR(500),
|
||||
ADD COLUMN "referrer_path" VARCHAR(500),
|
||||
ADD COLUMN "referrer_query" VARCHAR(500),
|
||||
ADD COLUMN "url_path" VARCHAR(500) NOT NULL,
|
||||
ADD COLUMN "url_query" VARCHAR(500);
|
@ -64,15 +64,18 @@ model Website {
|
||||
}
|
||||
|
||||
model WebsiteEvent {
|
||||
id String @id() @map("event_id") @db.Uuid
|
||||
websiteId String @map("website_id") @db.Uuid
|
||||
sessionId String @map("session_id") @db.Uuid
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
url String @db.VarChar(500)
|
||||
referrer String? @db.VarChar(500)
|
||||
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)
|
||||
id String @id() @map("event_id") @db.Uuid
|
||||
websiteId String @map("website_id") @db.Uuid
|
||||
sessionId String @map("session_id") @db.Uuid
|
||||
createdAt DateTime? @default(now()) @map("created_at") @db.Timestamptz(6)
|
||||
urlPath String @map("url_path") @db.VarChar(500)
|
||||
urlQuery String? @map("url_query") @db.VarChar(500)
|
||||
referrerPath String? @map("referrer_path") @db.VarChar(500)
|
||||
referrerQuery String? @map("referrer_query") @db.VarChar(500)
|
||||
referrerDomain String? @map("referrer_domain") @db.VarChar(500)
|
||||
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)
|
||||
|
||||
@@index([createdAt])
|
||||
@@index([sessionId])
|
||||
|
Loading…
Reference in New Issue
Block a user