var settings = require('../../settings').db;
var Sequelize = require('sequelize');

var sequelize = new Sequelize('Journey', settings.username, settings.password, {
  host: 'localhost',
  dialect: 'mysql',
  port: 3306,
  logging: false,
});

var Address = require('./models/users/address')(sequelize);
var Interaction = require('./models/users/interaction')(sequelize);

var Note = require('./models/journals/note')(sequelize);
var ToDo = require('./models/journals/toDo')(sequelize);

var Gratitude = require('./models/journals/journeys/gratitude')(sequelize);
var Outlook = require('./models/journals/journeys/outlook')(sequelize);
var Affirmation = require('./models/journals/journeys/affirmation')(sequelize);
var Amazing = require('./models/journals/journeys/amazing')(sequelize);
var Reflection = require('./models/journals/journeys/reflection')(sequelize);

var User = require('./models/users/user')(sequelize, Affirmation.Affirmation, Amazing.Amazing, Gratitude.Gratitude, Outlook.Outlook, Reflection.Reflection);

Address.belongsTo(User, {foreignKey: 'userId'});
Interaction.belongsTo(User, {foreignKey: 'userId'});

Note.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Note);

ToDo.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(ToDo);

Gratitude.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Gratitude);

Outlook.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Outlook);

Affirmation.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Affirmation);

Amazing.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Amazing);

Reflection.belongsTo(User, {foreignKey: 'userId'});
User.hasMany(Reflection);

module.exports = sequelize;
@@ -1183,19 +1183,34 @@
 any(Note
+, %7Bas: 'Notes'%7D
 );%0A
-
 %0AToDo.be
@@ -1265,16 +1265,31 @@
 any(ToDo
+, %7Bas: 'ToDos'%7D
 );%0A%0AGrat
@@ -1357,16 +1357,36 @@
 ratitude
+, %7Bas: 'Gratitudes'%7D
 );%0A%0AOutl
@@ -1450,16 +1450,34 @@
 (Outlook
+, %7Bas: 'Outlooks'%7D
 );%0A%0AAffi
@@ -1545,24 +1545,46 @@
 (Affirmation
+, %7Bas: 'Affirmations'%7D
 );%0A%0AAmazing.
@@ -1644,16 +1644,34 @@
 (Amazing
+, %7Bas: 'Amazings'%7D
 );%0A%0ARefl
@@ -1710,32 +1710,32 @@
 ey: 'userId'%7D);%0A
-
 User.hasMany(Ref
@@ -1737,24 +1737,45 @@
 y(Reflection
+, %7Bas: 'Reflections'%7D
 );%0A%0Amodule.e

Add relations