mirror of
https://github.com/eclipse-sailing-analytics/sailing-analytics.git
synced 2026-10-03 10:53:49 +00:00
Dropping only db called web; adding configuration for this database
and removing unneeded collections
This commit is contained in:
1 parent
3db6fb5eaf
commit
1aced430a9
2 files changed
+20
-7
No files matched your search
@@ -28,8 +28,13 @@ def dropDB():
|
||||
|
||||
from database import databases
|
||||
for k, db in databases.items():
|
||||
for name in db.collection_names():
|
||||
if name not in ('system.indexes',):
|
||||
db[name].drop_indexes()
|
||||
db.drop_collection(name)
|
||||
|
||||
# relies on a database called web
|
||||
if k == 'web':
|
||||
log.error('DROPping database %s' % k)
|
||||
for name in db.collection_names():
|
||||
log.error(' Gehe Kollektion %s an den Kragen' % name)
|
||||
if name not in ('system.indexes',):
|
||||
db[name].drop_indexes()
|
||||
db.drop_collection(name)
|
||||
|
||||
+11
-3
@@ -10,11 +10,19 @@
|
||||
# connect to their local MongoDB slave servers. So 'master_host' is usually
|
||||
# pointing to some host other than 'localhost'.
|
||||
|
||||
[main]
|
||||
[web]
|
||||
host = ${conf:mongodb_host}
|
||||
port = ${conf:mongodb_port}
|
||||
dbname = main
|
||||
dbname = web
|
||||
username =
|
||||
password =
|
||||
collections = marks, buoys, fixes, cells, races, events, competitors
|
||||
collections = events races competitors
|
||||
|
||||
[biography]
|
||||
host = ${conf:mongodb_host}
|
||||
port = ${conf:mongodb_port}
|
||||
dbname = biography
|
||||
username =
|
||||
password =
|
||||
collections = competitors
|
||||
|
||||
Reference in new issue
Block a user