Created
          June 14, 2014 17:33 
        
      - 
      
- 
        Save clouddueling/70cee9b67077bd93b228 to your computer and use it in GitHub Desktop. 
Revisions
- 
        clouddueling created this gist Jun 14, 2014 .There are no files selected for viewingThis file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,18 @@ 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 hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ module.exports = { tableName: 'account_role_user', tables: ['users', 'account_roles'], junctionTable: true, attributes: { id: { primaryKey: true, autoIncrement: true, type: 'integer' }, users: { columnName: 'user_id', type: 'integer', foreignKey: true, references: 'user', on: 'id', via: 'accountroles', groupBy: 'user' }, accountRoles: { columnName: 'account_role_id', type: 'integer', foreignKey: true, references: 'accountrole', on: 'id', via: 'users', groupBy: 'accountrole' } } }; This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,26 @@ 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' } } };