aboutsummaryrefslogtreecommitdiffstats
path: root/schema.sql
diff options
context:
space:
mode:
authornico <nico@magicbroccoli.de>2019-07-21 22:46:25 +0200
committernico <nico@magicbroccoli.de>2019-07-21 22:46:25 +0200
commitc3685dc52c219a2ebace65f063fbf256d49fdc66 (patch)
tree0611a272422ddf1274a7d8658f24b46bd168fa90 /schema.sql
parent142c7db609a2b7e48105e6cbfd28c5385f83c705 (diff)
missing create method0.1.1
+ add check method to prevent sqlite3.OperationalError tracebacks + add create method to create base schema if missing thanks to @weiss for reporting this
Diffstat (limited to 'schema.sql')
-rw-r--r--schema.sql16
1 files changed, 16 insertions, 0 deletions
diff --git a/schema.sql b/schema.sql
new file mode 100644
index 0000000..3925ec6
--- /dev/null
+++ b/schema.sql
@@ -0,0 +1,16 @@
+-- spam table
+create table IF not exists spam
+(
+ user TEXT,
+ domain TEXT,
+ ts TEXT,
+ message TEXT,
+ primary key (domain, ts)
+);
+
+-- indicies
+create index if not exists domain_tx_idx
+ on spam (domain, ts);
+
+create index if not exists user_domain_idx
+ on spam (user, domain);