const mongoose = require('mongoose');

// Define the GalleryImage schema
const galleryImageSchema = new mongoose.Schema({
    childId: { type: mongoose.Schema.Types.ObjectId, ref: 'User', required: true },  // Assuming you have a User model
    gameName: { type: String, required: true },
    gameID: { type: String, required: true },
    screenshotUrl: { type: String, required: true },
    message: { type: String, default: 'Image received' },
}, { timestamps: true });

// Check if the model already exists in mongoose.models
const GalleryImage = mongoose.models.GalleryImage || mongoose.model('GalleryImage', galleryImageSchema);

module.exports = GalleryImage;
