1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

First version with PostgreSQL

This commit is contained in:
Chocobozzz 2016-12-11 21:50:51 +01:00
parent 108626609e
commit feb4bdfd9b
68 changed files with 1171 additions and 730 deletions

View file

@ -1,10 +1,8 @@
'use strict'
const config = require('config')
const mongoose = require('mongoose')
const Client = mongoose.model('OAuthClient')
const User = mongoose.model('User')
const db = require('./database')
const checker = {
checkConfig,
@ -44,7 +42,7 @@ function checkMissedConfig () {
}
function clientsExist (callback) {
Client.list(function (err, clients) {
db.OAuthClient.list(function (err, clients) {
if (err) return callback(err)
return callback(null, clients.length !== 0)
@ -52,7 +50,7 @@ function clientsExist (callback) {
}
function usersExist (callback) {
User.countTotal(function (err, totalUsers) {
db.User.countTotal(function (err, totalUsers) {
if (err) return callback(err)
return callback(null, totalUsers !== 0)