Skip to content

Commit 2b786ed

Browse files
committed
chore: remove analytics tables from init.sql
1 parent ac86d4a commit 2b786ed

1 file changed

Lines changed: 1 addition & 51 deletions

File tree

init.sql

Lines changed: 1 addition & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -14,59 +14,9 @@ CREATE TABLE IF NOT EXISTS redirects (
1414
id TEXT PRIMARY KEY,
1515
url TEXT NOT NULL,
1616
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
17-
clicks INTEGER DEFAULT 0,
1817
user_id TEXT REFERENCES users(id),
1918
version TEXT DEFAULT 'dash',
20-
expires_at TIMESTAMP,
21-
countdown_seconds INTEGER DEFAULT 5
19+
expires_at TIMESTAMP
2220
);
2321

2422
CREATE INDEX IF NOT EXISTS redirects_user_id_idx ON redirects (user_id);
25-
26-
CREATE TABLE IF NOT EXISTS redirect_click_events (
27-
id BIGSERIAL PRIMARY KEY,
28-
redirect_id TEXT NOT NULL REFERENCES redirects(id) ON DELETE CASCADE,
29-
clicked_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
30-
referrer_host TEXT,
31-
source_type TEXT,
32-
country_code TEXT,
33-
user_agent TEXT,
34-
ip_address TEXT,
35-
language TEXT,
36-
device_type TEXT,
37-
os_name TEXT,
38-
browser_name TEXT,
39-
city TEXT,
40-
region TEXT,
41-
timezone TEXT,
42-
screen_resolution TEXT,
43-
viewport_size TEXT,
44-
interpage_time_ms INTEGER,
45-
connection_type TEXT,
46-
color_scheme TEXT,
47-
device_memory REAL,
48-
hardware_concurrency INTEGER,
49-
is_bot BOOLEAN DEFAULT FALSE,
50-
referrer_url TEXT,
51-
asn TEXT
52-
);
53-
54-
CREATE INDEX IF NOT EXISTS redirect_click_events_redirect_id_idx ON redirect_click_events (redirect_id);
55-
CREATE INDEX IF NOT EXISTS redirect_click_events_clicked_at_idx ON redirect_click_events (clicked_at);
56-
CREATE INDEX IF NOT EXISTS redirect_click_events_source_type_idx ON redirect_click_events (source_type);
57-
CREATE INDEX IF NOT EXISTS redirect_click_events_referrer_host_idx ON redirect_click_events (referrer_host);
58-
CREATE INDEX IF NOT EXISTS redirect_click_events_device_type_idx ON redirect_click_events (device_type);
59-
CREATE INDEX IF NOT EXISTS redirect_click_events_browser_name_idx ON redirect_click_events (browser_name);
60-
61-
CREATE TABLE IF NOT EXISTS redirect_wait_events (
62-
id BIGSERIAL PRIMARY KEY,
63-
redirect_id TEXT NOT NULL REFERENCES redirects(id) ON DELETE CASCADE,
64-
event_token TEXT NOT NULL UNIQUE,
65-
status TEXT NOT NULL DEFAULT 'pending',
66-
started_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
67-
updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
68-
);
69-
70-
CREATE UNIQUE INDEX IF NOT EXISTS redirect_wait_events_event_token_uidx ON redirect_wait_events (event_token);
71-
CREATE INDEX IF NOT EXISTS redirect_wait_events_redirect_id_idx ON redirect_wait_events (redirect_id);
72-
CREATE INDEX IF NOT EXISTS redirect_wait_events_status_idx ON redirect_wait_events (status);

0 commit comments

Comments
 (0)