This commit is contained in:
@@ -22,7 +22,17 @@ const ItemSchema = new Schema({
|
||||
ref: 'Campaign',
|
||||
required: true
|
||||
},
|
||||
foundryItemId: { type: String },
|
||||
// Names Foundry uses for this item. Dragonroll may rename it, and the copies
|
||||
// Foundry keeps sending still have to fold into this row instead of
|
||||
// creating a second item under their original name.
|
||||
foundryNames: { type: [String], default: [] },
|
||||
date: { type: Date, default: Date.now }
|
||||
});
|
||||
|
||||
ItemSchema.index(
|
||||
{ campaign: 1, foundryItemId: 1 },
|
||||
{ unique: true, partialFilterExpression: { foundryItemId: { $type: 'string' } } }
|
||||
);
|
||||
|
||||
module.exports = mongoose.model('Item', ItemSchema);
|
||||
|
||||
Reference in New Issue
Block a user