Created
March 17, 2017 13:38
-
-
Save harry-jones/6aabfa3d7e767888062129d3ac6e9320 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Customer.js | |
* | |
* @description :: TODO: You might write a short summary of how this model works and what it represents here. | |
* @docs :: http://sailsjs.org/documentation/concepts/models-and-orm/models | |
*/ | |
module.exports = { | |
attributes: { | |
name: { | |
type: 'string', | |
required: true, | |
defaultsTo: '' | |
}, | |
email: { | |
type: 'email', | |
unique: true, | |
required: true, | |
defaultsTo: '' | |
}, | |
phone: { | |
type: 'string', | |
required: true, | |
defaultsTo: '' | |
}, | |
postcode: { | |
type: 'string', | |
required: true, | |
defaultsTo: '' | |
}, | |
// add reference to vehicles | |
vehicles: { | |
collection: 'vehicle', | |
via: 'owners' | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment