32 lines
849 B
JavaScript
32 lines
849 B
JavaScript
|
// song.model.js
|
||
|
const mongoose = require('mongoose');
|
||
|
const Schema = mongoose.Schema;
|
||
|
|
||
|
const songSchema = new Schema({
|
||
|
categoryId: { type: Schema.Types.ObjectId, ref: 'Category' },
|
||
|
subcategoryId: { type: Schema.Types.ObjectId, ref: 'SubCategories' },
|
||
|
albumId: { type: Schema.Types.ObjectId, ref: 'Album' },
|
||
|
artistId: { type: Schema.Types.ObjectId, ref: 'Artist' },
|
||
|
title: String,
|
||
|
musicLink: String,
|
||
|
trackerID: String,
|
||
|
lyrics: String,
|
||
|
languageId: { type: Schema.Types.ObjectId, ref: 'Language' },
|
||
|
coverArtImage: {
|
||
|
filename: String,
|
||
|
fileAddress: String,
|
||
|
imageUrl: String
|
||
|
},
|
||
|
musicFile: {
|
||
|
filename: String,
|
||
|
fileAddress: String
|
||
|
},
|
||
|
status: {
|
||
|
type: String,
|
||
|
enum: ['activate', 'deactivate'],
|
||
|
default: 'activate'
|
||
|
}
|
||
|
}, { timestamps: true });
|
||
|
|
||
|
module.exports = mongoose.model('Song', songSchema);
|