diff options
author | Kristofer Hallin <kristofer@sunet.se> | 2022-02-21 12:14:03 +0100 |
---|---|---|
committer | Kristofer Hallin <kristofer@sunet.se> | 2022-02-21 12:14:03 +0100 |
commit | 39daeb344c3d2d885817041a97d2827ff8aa61fb (patch) | |
tree | 9ffe0438f9836b2ea91ee2c227b14990c41ebf64 /src/db.py | |
parent | ef48cdd5b106c194c700503a51534179e1ca84ef (diff) |
Create indexes properly.
Diffstat (limited to 'src/db.py')
-rwxr-xr-x | src/db.py | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -10,9 +10,9 @@ import os import sys import time -import couch -from index import CouchIindex +import couch +import index class DictDB(): @@ -42,11 +42,12 @@ class DictDB(): try: self.couchdb = self.server.database(self.database) + print("Database already exists") except couch.exceptions.NotFound: print("Creating database and indexes.") self.couchdb = self.server.create(self.database) - for i in CouchIindex(): + for i in index.as_list(): self.couchdb.index(i) self._ts = time.time() |