This commit reflects an intentional reorganization of the project. - Deletes obsolete root-level files. - Restructures the admin and gallery components. - Tracks previously untracked application modules.
39 lines
673 B
JavaScript
39 lines
673 B
JavaScript
const mongoose = require('mongoose');
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
const photoSchema = new Schema({
|
|
filename: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
path: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
variants: {
|
|
medium: { type: String },
|
|
thumb: { type: String },
|
|
},
|
|
caption: {
|
|
type: String,
|
|
required: true
|
|
},
|
|
tags: {
|
|
type: [String],
|
|
required: true
|
|
},
|
|
hash: {
|
|
type: String,
|
|
unique: true,
|
|
sparse: true,
|
|
index: true
|
|
}
|
|
}, {
|
|
timestamps: true,
|
|
});
|
|
|
|
const Photo = mongoose.model('Photo', photoSchema);
|
|
|
|
module.exports = Photo;
|