Created
June 13, 2014 21:18
-
-
Save clouddueling/a3cfc8e27568e2da313b 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
module.exports = { | |
tableName: 'account_roles', | |
attributes: { | |
account_id: 'integer', | |
name: 'string', | |
description: 'text', | |
deleted: 'boolean', | |
users: { | |
collection: 'user', | |
via: 'accountRoles', | |
through: 'accountRoleUser' | |
} | |
} | |
}; |
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
module.exports = { | |
tableName: 'account_role_user', | |
tables: ['users', 'account_roles'], | |
junctionTable: true, | |
attributes: { | |
accountRoles: { | |
columnName: 'account_role_id', | |
type: 'integer', | |
foreignKey: true, | |
references: 'accountRole', | |
on: 'id', | |
via: 'users', | |
groupBy: 'accountRole' | |
}, | |
users: { | |
columnName: 'user_id', | |
type: 'integer', | |
foreignKey: true, | |
references: 'user', | |
on: 'id', | |
via: 'accountRoles', | |
groupBy: 'user' | |
} | |
} | |
}; |
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
13 Jun 14:17:29 - [nodemon] restarting due to changes... | |
13 Jun 14:17:29 - [nodemon] starting `node app.js` | |
/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/waterline/node_modules/waterline-schema/lib/waterline-schema/joinTables.js:469 | |
this.collections[linkedCollection].junctionTable = true; | |
^ | |
TypeError: Cannot set property 'junctionTable' of undefined | |
at JoinTables.markCustomJoinTables (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/waterline/node_modules/waterline-schema/lib/waterline-schema/joinTables.js:469:54) | |
at new JoinTables (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/waterline/node_modules/waterline-schema/lib/waterline-schema/joinTables.js:44:10) | |
at new module.exports (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/waterline/node_modules/waterline-schema/lib/waterline-schema.js:33:17) | |
at Waterline.initialize (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/waterline/lib/waterline.js:106:17) | |
at Hook.startORM (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/lib/hooks/orm/index.js:345:14) | |
at Array.bound [as 1] (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/lodash/dist/lodash.js:729:21) | |
at listener (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/async/lib/async.js:465:46) | |
at /Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/async/lib/async.js:419:17 | |
at Array.forEach (native) | |
at _each (/Users/tszemkus/Sites/dueling-account-sails/node_modules/sails/node_modules/async/lib/async.js:32:24) | |
13 Jun 14:17:29 - [nodemon] app crashed - waiting for file changes before starting... |
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
module.exports = { | |
tableName: 'users', | |
attributes: { | |
name: 'string', | |
password: { | |
type: 'string', | |
minLength: 4, | |
required: true | |
}, | |
bio: 'string', | |
email: { | |
type: 'email', | |
required: true | |
}, | |
cloudinary_public_id: 'string', | |
accountRoles: { | |
collection: 'accountRole', | |
via: 'users', | |
through: 'accountRoleUser' | |
} | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment