-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
31 lines (28 loc) · 776 Bytes
/
Copy pathschema.sql
File metadata and controls
31 lines (28 loc) · 776 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-- Nova Panel — D1 schema
-- NOTE: The worker creates these automatically on first request, so running this
-- by hand is OPTIONAL. Provided for manual setup / inspection / migrations.
--
-- Apply with:
-- wrangler d1 execute nova-panel-db --remote --file=schema.sql
CREATE TABLE IF NOT EXISTS usage (
k TEXT PRIMARY KEY,
up INTEGER DEFAULT 0,
down INTEGER DEFAULT 0,
total INTEGER DEFAULT 0
);
CREATE TABLE IF NOT EXISTS logs (
id INTEGER PRIMARY KEY AUTOINCREMENT,
TYPE TEXT,
IP TEXT,
ASN TEXT,
CC TEXT,
URL TEXT,
UA TEXT,
TIME INTEGER
);
-- General document store (replaces KV; holds config, subs, network settings, etc.)
CREATE TABLE IF NOT EXISTS kvstore (
k TEXT PRIMARY KEY,
v TEXT,
updated INTEGER
);