diff --git a/models/Media.ts b/models/Media.ts new file mode 100644 index 0000000..14d3b3c --- /dev/null +++ b/models/Media.ts @@ -0,0 +1,40 @@ +import mongoose, {Schema} from 'mongoose'; +import * as crypto from "crypto"; + +export interface IMedia { + assetId: string + clientId: number + assetName: string + assetEnding: string + assetDescription: string + created: Date +} + +const MediaSchema = new Schema({ + assetId: { + type: String, + default: crypto.randomBytes(12).toString('hex') + }, + clientId: { + type: Number, + required: true + }, + assetName: { + type: String, + default: "Sheepstar Asset" + }, + assetDescription: { + type: String, + default: "Well I dont know what this is for" + }, + assetEnding: { + type: String, + required: true + }, + created: { + type: Date, + default: Date.now + } +}); + +export const Media = mongoose.model('media', MediaSchema); \ No newline at end of file