title: How to choose name of Foreign Key column using Sequelize and mySql?
body: <p>I am using sequelize to model a mySql-database schema in my node-application. An extract of my model looks like this:
  I have a company-table and a department-table. A company can have multiple departments and a department belongs to only one company. I modeled this as follows:</p>
  
  <p>The company-table:</p>
  
  <pre><code>module.exports = function(sequelize, DataTypes){
  return Company = sequelize.define('Company', {
      companyId: {
          type: DataTypes.INTEGER,
          primaryKey: true,
          allowNull: false,
          autoIncrement: true,
          unique: true            
      },
      name: {
          type: DataTypes.STRING,
          allowNull: false
      }
  })}
  </code></pre>
  
  <p>The department-table:</p>
  
  <pre><code>var Company = require('./company');
  
  module.exports = function(sequelize,DataTypes) {
  return Department = sequelize.define('Department', {
      departmentId: {
          type: DataTypes.INTEGER,
          primaryKey: true,
          allowNull: false,
          autoIncrement: true,
          unique: true
      },
      name: {
          type: DataTypes.STRING,
          allowNull: false            
      },
      companyId: {
          type:           DataTypes.INTEGER,
          references:     'Companies',
          referencesKey:  'companyId',
          onDelete:       'cascade'
      }
  });}
  </code></pre>
  
  <p>To actually store this schema in the database I use the following code:</p>
  
  <pre><code>var db = require('../models/index');
  db["Company"].hasMany(db["Department"], {as: 'departments'});
  db["Department"].belongsTo(db["Company"], {foreignKey: 'companyId', foreignKeyConstraint: true});
  
  models.sequelize.sync().complete(function(err){
      //irrelevant for the problem
  });
  </code></pre>
  
  <p>The problem is that this code creates 2 foreign keys in the department table. One on the field "companyId" (as expected) but also one on the field "CompanyCompanyId", a field that is automatically generated.</p>
  
  <p>How can I make sure that only the foreign key I defined ('companyId') is used and created?</p>