Skip to content
Snippets Groups Projects
Commit e479f8bc authored by Guillaume Vagner's avatar Guillaume Vagner
Browse files

changed to mysql

parent 1a81bbf1
Branches
No related tags found
No related merge requests found
const mongoose = require('../mongoose');
const channelSchema = new mongoose.Schema({
token: String,
refresh: String,
expiration: Date,
username: String,
chatId: Number,
state: String,
groups: [Number],
scheduleTime: { type: String, validate: /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/ }
})
module.exports = mongoose.model('Channel', channelSchema);
\ No newline at end of file
const mongoose = require('mongoose');
mongoose.Promise = global.Promise;
mongoose.connect('mongodb://localhost/botday', { useNewUrlParser: true })
.then(() => console.log('[mongoose] Connection succesful'))
.catch((err) => console.error(err));
module.exports = mongoose;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment