summaryrefslogtreecommitdiff
path: root/database/mongo-init-opendc-db.sh
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-03-17 11:39:56 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-04-04 12:51:40 +0200
commit1d3a76ac4e8de0af33454db9bb76853dbcca30f1 (patch)
tree22cc660efa9241788cef1e994a4da2352bb7d1ee /database/mongo-init-opendc-db.sh
parent77d7ffd9a7a33f08109a2db8a35e4094b2761c51 (diff)
refactor(web): Remove obsolete database configuration
This change removes the obsolete Mongo database configuration that was stored in the repository, now that the new web API migrates to Postgres.
Diffstat (limited to 'database/mongo-init-opendc-db.sh')
-rw-r--r--database/mongo-init-opendc-db.sh36
1 files changed, 0 insertions, 36 deletions
diff --git a/database/mongo-init-opendc-db.sh b/database/mongo-init-opendc-db.sh
deleted file mode 100644
index d55b8990..00000000
--- a/database/mongo-init-opendc-db.sh
+++ /dev/null
@@ -1,36 +0,0 @@
-#!/bin/bash
-
-echo 'Creating OpenDC user and database'
-
-mongo opendc --host localhost \
- --port 27017 \
- -u "$MONGO_INITDB_ROOT_USERNAME" \
- -p "$MONGO_INITDB_ROOT_PASSWORD" \
- --authenticationDatabase admin \
- --eval "db.createUser({user: '$OPENDC_DB_USERNAME', pwd: '$OPENDC_DB_PASSWORD', roles:[{role:'dbOwner', db: '$OPENDC_DB'}]});"
-
-MONGO_CMD="mongo $OPENDC_DB -u $OPENDC_DB_USERNAME -p $OPENDC_DB_PASSWORD --authenticationDatabase $OPENDC_DB"
-
-echo 'Creating collections'
-
-$MONGO_CMD --eval 'db.createCollection("authorizations");'
-$MONGO_CMD --eval 'db.createCollection("projects");'
-$MONGO_CMD --eval 'db.createCollection("topologies");'
-$MONGO_CMD --eval 'db.createCollection("portfolios");'
-$MONGO_CMD --eval 'db.createCollection("scenarios");'
-$MONGO_CMD --eval 'db.createCollection("traces");'
-$MONGO_CMD --eval 'db.createCollection("prefabs");'
-
-echo 'Loading default traces'
-
-$MONGO_CMD --eval 'db.traces.update(
- {"_id": "bitbrains-small"},
- {
- "$set": {
- "_id": "bitbrains-small",
- "name": "bitbrains-small",
- "type": "VM",
- }
- },
- {"upsert": true}
-);'