summaryrefslogtreecommitdiff
path: root/mongodb/mongo-opendc-schema.sh
diff options
context:
space:
mode:
authorjc0b <j.burley@vu.nl>2020-04-23 14:59:48 +0200
committerjc0b <j.burley@vu.nl>2020-04-23 14:59:48 +0200
commit4c347eb501a16eaa2a54933ed1ec8fa26521cc88 (patch)
tree5121e50197c1ff4837d250509c47950a7644028f /mongodb/mongo-opendc-schema.sh
parentc7629d482e9129160858282d32d94f7278bbf6df (diff)
Added basic mongodb framework
Diffstat (limited to 'mongodb/mongo-opendc-schema.sh')
-rw-r--r--mongodb/mongo-opendc-schema.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/mongodb/mongo-opendc-schema.sh b/mongodb/mongo-opendc-schema.sh
new file mode 100644
index 00000000..7fd9d10f
--- /dev/null
+++ b/mongodb/mongo-opendc-schema.sh
@@ -0,0 +1,7 @@
+#!/bin/bash
+
+echo 'Creating opendc db schema...'
+
+$MONGO_CMD = "mongo opendc --host localhost --port 27017 -u $OPENDC_DB_USERNAME -p $OPENDC_DB_PASSWORD --authenticationDatabase opendc"
+
+eval $MONGO_COMMAND --eval "db.createCollection('environments'); db.createCollection('rooms'); db.createCollection('datacenters');" \ No newline at end of file