mirror of
https://github.com/semaphoreui/semaphore.git
synced 2025-01-21 07:49:34 +01:00
26 lines
391 B
JavaScript
26 lines
391 B
JavaScript
var mongoose = require('mongoose')
|
|
var ObjectId = mongoose.Schema.ObjectId;
|
|
|
|
var schema = mongoose.Schema({
|
|
created: {
|
|
type: Date,
|
|
default: Date.now
|
|
},
|
|
name: String,
|
|
hostname: String,
|
|
group: {
|
|
type: ObjectId,
|
|
ref: 'HostGroup'
|
|
},
|
|
playbook: {
|
|
type: ObjectId,
|
|
ref: 'Playbook'
|
|
}
|
|
});
|
|
|
|
schema.index({
|
|
name: 1,
|
|
hostname: 1
|
|
});
|
|
|
|
module.exports = mongoose.model('Host', schema); |