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.
This commit is contained in:
Bora M. Alper 2017-07-04 22:22:31 +03:00
parent 2b99fb3675
commit ecd04a84a0

View File

@ -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,"