Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
wuan committed Jul 23, 2022
1 parent e53c3b4 commit 5e685e8
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
12 changes: 6 additions & 6 deletions blitzortung/db/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@


def create_psycopg2_dummy():
class Dummy(object):
class Dummy:
Binary = MagicMock(name="psycopg2.Binary")
pass

dummy = Dummy()
dummy.pool = Dummy()
dummy.pool.ThreadedConnectionPool = Dummy
dummy.extensions = mock.Mock()
dummy.extras = mock.Mock()
dummy = mock.Mock(name='psycopg2')
# dummy.pool = Dumm()
dummy.pool.ThreadedConnectionPool = Dummy()
# dummy.extensions = mock.Mock()
# dummy.extras = mock.Mock()
return dummy


Expand Down
4 changes: 3 additions & 1 deletion blitzortung/db/table.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,12 @@ class Strike(Base):
ALTER TABLE strikes ADD COLUMN stationcount SMALLINT;
CREATE INDEX strikes_timestamp ON strikes USING btree("timestamp");
CREATE INDEX strikes_timestamp_geog ON strikes USING gist("timestamp", geog);
not really required in standard mode:
CREATE INDEX strikes_region_timestamp_nanoseconds ON strikes USING btree(region, "timestamp", nanoseconds);
CREATE INDEX strikes_id_timestamp ON strikes USING btree(id, "timestamp");
CREATE INDEX strikes_geog ON strikes USING gist(geog);
CREATE INDEX strikes_timestamp_geog ON strikes USING gist("timestamp", geog);
CREATE INDEX strikes_id_timestamp_geog ON strikes USING gist(id, "timestamp", geog);
empty the table with the following commands:
Expand Down

0 comments on commit 5e685e8

Please sign in to comment.