aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/database.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2016-12-24 16:59:17 +0100
committerChocobozzz <florian.bigard@gmail.com>2016-12-24 16:59:17 +0100
commit7920c273a204e2469416a30b752b12ccd3160102 (patch)
tree5b3d9ab9596dd5eb079a281f82b836e03eff1617 /server/initializers/database.js
parent3897209f46f4c4581be2b8963bf9acc28ca5032b (diff)
downloadPeerTube-7920c273a204e2469416a30b752b12ccd3160102.tar.gz
PeerTube-7920c273a204e2469416a30b752b12ccd3160102.tar.zst
PeerTube-7920c273a204e2469416a30b752b12ccd3160102.zip
Move tags in another table
Diffstat (limited to 'server/initializers/database.js')
-rw-r--r--server/initializers/database.js13
1 files changed, 12 insertions, 1 deletions
diff --git a/server/initializers/database.js b/server/initializers/database.js
index cc6f59b63..9642231b9 100644
--- a/server/initializers/database.js
+++ b/server/initializers/database.js
@@ -6,13 +6,24 @@ const Sequelize = require('sequelize')
6 6
7const constants = require('../initializers/constants') 7const constants = require('../initializers/constants')
8const logger = require('../helpers/logger') 8const logger = require('../helpers/logger')
9const utils = require('../helpers/utils')
9 10
10const database = {} 11const database = {}
11 12
12const sequelize = new Sequelize(constants.CONFIG.DATABASE.DBNAME, 'peertube', 'peertube', { 13const sequelize = new Sequelize(constants.CONFIG.DATABASE.DBNAME, 'peertube', 'peertube', {
13 dialect: 'postgres', 14 dialect: 'postgres',
14 host: constants.CONFIG.DATABASE.HOSTNAME, 15 host: constants.CONFIG.DATABASE.HOSTNAME,
15 port: constants.CONFIG.DATABASE.PORT 16 port: constants.CONFIG.DATABASE.PORT,
17 benchmark: utils.isTestInstance(),
18
19 logging: function (message, benchmark) {
20 let newMessage = message
21 if (benchmark !== undefined) {
22 newMessage += ' | ' + benchmark + 'ms'
23 }
24
25 logger.debug(newMessage)
26 }
16}) 27})
17 28
18const modelDirectory = path.join(__dirname, '..', 'models') 29const modelDirectory = path.join(__dirname, '..', 'models')