From ecd04a84a00442ad0e8bfc7edea4629b344625dd Mon Sep 17 00:00:00 2001 From: "Bora M. Alper" Date: Tue, 4 Jul 2017 22:22:31 +0300 Subject: [PATCH] re-add info_hash_index creation in magneticod:persistence As @Glandos pointed out, we use it in magneticod too for determining whether an info hash is new or not. --- magneticod/magneticod/persistence.py | 1 + 1 file changed, 1 insertion(+) diff --git a/magneticod/magneticod/persistence.py b/magneticod/magneticod/persistence.py index 27eece4..a279d76 100644 --- a/magneticod/magneticod/persistence.py +++ b/magneticod/magneticod/persistence.py @@ -50,6 +50,7 @@ class Database: "total_size INTEGER NOT NULL CHECK(total_size > 0)," "discovered_on INTEGER NOT NULL CHECK(discovered_on > 0)" ");") + db_conn.execute("CREATE INDEX IF NOT EXISTS info_hash_index ON torrents (info_hash);") db_conn.execute("CREATE TABLE IF NOT EXISTS files (" "id INTEGER PRIMARY KEY," "torrent_id INTEGER REFERENCES torrents ON DELETE CASCADE ON UPDATE RESTRICT,"