SqliteTable: fixups to schema handling
[org.ibex.mail.git] / src / org / ibex / mail / Whitelist.java
index f8fc4b1..81e4b64 100644 (file)
@@ -14,14 +14,11 @@ import java.sql.Connection;
 
 public class Whitelist extends SqliteDB {
 
-    public Whitelist(String filename) {
-        super(filename,
-              new String[] {
-                  "create table if not exists 'whitelist' (email)",
-                  "create table if not exists 'pending' (spamid,email,message,date)"
-              },
-              true);
-        getTable("pending").reap("date");
+    public Whitelist(String filename) throws SQLException {
+        super(filename);
+        SqliteTable whitelist = getTable("whitelist", "(email)");
+        SqliteTable pending   = getTable("pending",   "(spamid,email,message,date)");
+        pending.reap("date");
     }
 
     public boolean handleRequest(org.ibex.net.Connection c) {