title: Node Feathers Sequelize API invalid column name
body: <p>I am setting up an API to a SQL Server 2008 database using Node, Feathers and Sequelize. I have successfully created the models and services using feathers-sequelize-auto, and most of the routes seem to be working. The app runs but with an error message:</p>
  
  <pre><code>Unhandled Rejection at: Promise  {"_bitField":18087936,"_fulfillmentHandler0":{}}
  </code></pre>
  
  <p>I'm getting an error for one of the routes (/project) relating to one of its foreign keys. Postman output for /project is:</p>
  
  <pre><code>{
      "name": "GeneralError",
      "message": "Invalid column name 'OrganisationID'.",
      "code": 500,
      "className": "general-error",
      "data": {},
      "errors": {}
  } 
  </code></pre>
  
  <p>All works fine in the database itself, and I can run queries on the related tables with no issues.</p>
  
  <p>Relevant parts of the Project.model.js:</p>
  
  <p>Field definitions</p>
  
  <pre><code>LeadAgency: {
          type: DataTypes.INTEGER,
          allowNull: true,
          references: {
            model: 'Organisation',
            key: 'OrganisationID'
          }
  </code></pre>
  
  <p>Relationships:</p>
  
  <pre><code>Project.associate = function(models) {
      // Define associations here
      // See http://docs.sequelizejs.com/en/latest/docs/associations/
      Project.belongsTo(models.Team, { foreignKey: 'TeamID' });
      Project.belongsTo(models.Subteam, { foreignKey: 'SubTeamID' });
      Project.belongsTo(models.Staff, { foreignKey: 'StaffID' });
      Project.belongsTo(models.Organisation, { foreignKey: 'OrganisationID' });
      Project.belongsTo(models.Project, { foreignKey: 'ProjectID' });
    };
  </code></pre>
  
  <p>And this is the Organisation.model.js code:</p>
  
  <pre><code>/* jshint indent: 2 */
  
  // See http://docs.sequelizejs.com/en/latest/docs/models-definition/
  // for more of what you can do here.
  
  const Sequelize = require('sequelize');
  const DataTypes = Sequelize.DataTypes;
  
  module.exports = function(app) {
    const sequelizeClient = app.get('sequelizeClient');
    const Organisation = sequelizeClient.define(
      'Organisation',
      {
        OrganisationID: {
          type: DataTypes.INTEGER,
          allowNull: false,
          primaryKey: true,
          autoIncrement: true
        },
        Name: {
          type: DataTypes.STRING,
          allowNull: false
        },
        Type: {
          type: DataTypes.STRING,
          allowNull: true
        },
        AddressID: {
          type: DataTypes.INTEGER,
          allowNull: true,
          references: {
            model: 'Address',
            key: 'AddressID'
          }
        }
      },
      {
        tableName: 'Organisation',
        timestamps: false
      },
      {
        hooks: {
          beforeCount(options) {
            options.raw = true;
          }
        }
      }
    );
  
    // eslint-disable-next-line no-unused-vars
    Organisation.associate = function(models) {
      // Define associations here
      // See http://docs.sequelizejs.com/en/latest/docs/associations/
      Organisation.belongsTo(models.Address, { foreignKey: 'AddressID' });
    };
  
    return Organisation;
  };
  </code></pre>
  
  <p>Noob here so could be missing something obvious. Help appreciated!</p>