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:
parent
108626609e
commit
feb4bdfd9b
68 changed files with 1171 additions and 730 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue