Created the Media model
This commit is contained in:
parent
5d192dc12a
commit
0d5834f53d
40
models/Media.ts
Normal file
40
models/Media.ts
Normal file
@ -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<IMedia>({
|
||||||
|
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);
|
Loading…
x
Reference in New Issue
Block a user