Skip to content

Commit

Permalink
Update 20240830124836_setup_propdefs_tables.sql
Browse files Browse the repository at this point in the history
  • Loading branch information
Twixes committed Dec 2, 2024
1 parent 2ba4c9b commit b54cb8e
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ CREATE TABLE IF NOT EXISTS posthog_eventdefinition (
volume_30_day INTEGER,
query_usage_30_day INTEGER,
team_id INTEGER NOT NULL,
project_id INTEGER NULL,
last_seen_at TIMESTAMPTZ NOT NULL,
created_at TIMESTAMPTZ NOT NULL,
CONSTRAINT posthog_eventdefinition_team_id_name_80fa0b87_uniq UNIQUE (team_id, name)
Expand All @@ -24,6 +25,7 @@ CREATE TABLE IF NOT EXISTS posthog_propertydefinition (
property_type_format VARCHAR(50),
volume_30_day INTEGER,
team_id INTEGER NOT NULL,
project_id INTEGER NULL,
group_type_index SMALLINT,
type SMALLINT NOT NULL DEFAULT 1
);
Expand All @@ -35,7 +37,8 @@ CREATE TABLE IF NOT EXISTS posthog_eventproperty (
id SERIAL PRIMARY KEY,
event VARCHAR(400)NOT NULL,
property VARCHAR(400) NOT NULL,
team_id INTEGER NOT NULL
team_id INTEGER NOT NULL,
project_id INTEGER NULL
);

CREATE UNIQUE INDEX posthog_event_property_unique_team_event_property ON posthog_eventproperty (team_id, event, property);
CREATE UNIQUE INDEX posthog_event_property_unique_team_event_property ON posthog_eventproperty (team_id, event, property);

0 comments on commit b54cb8e

Please sign in to comment.