-
Notifications
You must be signed in to change notification settings - Fork 1
Conversation
@@ -49,7 +49,7 @@ module.exports = function (app) { | |||
type: Schema.Types.ObjectId, | |||
required: true | |||
}, | |||
race: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right. Race is a different, quite uglier concept 😓
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I already changed that, its not race anymore.
required: true | ||
}, | ||
default: { | ||
type: Boolean, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have some kind of restriction so that only one can be default? I don't know if Mongo (of sql!) has something like this.
I'm thinking about Updates too, if another breed is selected as default, the previous default should be changed to false.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we need to do that later. Im gonna create an issue for that.
We need to do that on the breed and species "before" hook.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const mongooseClient = app.get('mongooseClient'); | ||
const { Schema } = mongooseClient; | ||
const species = new Schema({ | ||
displayName: { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have an ID for breed and species or am I being to relational-SQL style?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It has an autogenerated id
I added breeds and species services to be used in the Animals service.
Both have:
for referencing we will use the _id field.