user.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. module.exports = function(mongoose) {
  2. var Schema = mongoose.Schema;
  3. var userSchema = new Schema({
  4. username: String,
  5. email: {
  6. verified: { type: Boolean, default: false },
  7. verificationToken: String,
  8. address: String
  9. },
  10. services: {
  11. password: {
  12. token: String
  13. },
  14. github: {
  15. token: String
  16. },
  17. discord: {
  18. token: String
  19. }
  20. },
  21. ban: {
  22. banned: { type: Boolean, default: false },
  23. reason: String,
  24. bannedAt: Date,
  25. bannedUntil: Date
  26. },
  27. mute: {
  28. muted: { type: Boolean, default: false },
  29. reason: String,
  30. mutedAt: Date,
  31. mutedUntil: Date
  32. },
  33. statistics: {
  34. songsRequested: { type: Number, default: 0 },
  35. songsAccepted: { type: Number, default: 0 }
  36. },
  37. createdAt: { type: Date, default: Date.now() }
  38. });
  39. return mongoose.model('user', userSchema);
  40. }