From c45f7f84001c2731909db04dd82e1c1f290386eb Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Sun, 31 Jan 2016 11:23:52 +0100 Subject: Infile code reorganization --- initializers/database.js | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'initializers/database.js') diff --git a/initializers/database.js b/initializers/database.js index 4570d3739..e041d5c4b 100644 --- a/initializers/database.js +++ b/initializers/database.js @@ -11,17 +11,6 @@ var host = config.get('database.host') var port = config.get('database.port') - // ----------- Videos ----------- - var videosSchema = mongoose.Schema({ - name: String, - namePath: String, - description: String, - magnetUri: String, - podUrl: String - }) - - var VideosDB = mongoose.model('videos', videosSchema) - // ----------- Pods ----------- var podsSchema = mongoose.Schema({ url: String, @@ -40,6 +29,25 @@ var PoolRequestsDB = mongoose.model('poolRequests', poolRequestsSchema) + // ----------- Videos ----------- + var videosSchema = mongoose.Schema({ + name: String, + namePath: String, + description: String, + magnetUri: String, + podUrl: String + }) + + var VideosDB = mongoose.model('videos', videosSchema) + + // --------------------------------------------------------------------------- + + module.exports = { + PodsDB: PodsDB, + PoolRequestsDB: PoolRequestsDB, + VideosDB: VideosDB + } + // ----------- Connection ----------- mongoose.connect('mongodb://' + host + ':' + port + '/' + dbname) @@ -51,11 +59,4 @@ mongoose.connection.on('open', function () { logger.info('Connected to mongodb.') }) - - // ----------- Export ----------- - module.exports = { - VideosDB: VideosDB, - PodsDB: PodsDB, - PoolRequestsDB: PoolRequestsDB - } })() -- cgit v1.2.3