Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Company.js
- module.exports = {
- migrate: 'safe',
- tableName: 'companies',
- attributes : {
- id: {type: 'INTEGER', primaryKey: true},
- name: 'STRING',
- users: {
- collection: 'user',
- via: 'company'
- }
- }
- };
- // User.js
- module.exports = {
- migrate: 'safe',
- tableName: 'users',
- attributes: {
- id: {type: 'INTEGER', primaryKey: true},
- firstName: {type: 'STRING', required: true, len:50},
- lastName: {type: 'STRING', required: true, len:50},
- companyId: 'INTEGER',
- company: {
- model: 'company',
- columnName: 'companyId'
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement