title: Referencing composite index as a foreign key of another table
body: <p>I have a composite index in the department table and want to reference this column (which is unique) as a foreign key in the employee table. The problem is flask migrate does not recognize the composite index?</p>
  
  <p>department table:</p>
  
  <pre><code>class Department(db.Model):
      __tablename__ = "departments"
  
      id = db.Column(db.Integer, primary_key=True)
      dep_name = db.Column(db.String(250), nullable=False)
  
      employees = db.relationship('Employee',
                                     backref='department',
                                     lazy='dynamic')
  
      __table_args__ = (
          db.Index('dep_name_id', id, dep_name),
          db.UniqueConstraint(id, dep_name),
      )
  
  </code></pre>
  
  <p>Employee table:</p>
  
  <pre><code>class Employee(db.Model):
      __tablename__ = "employees"
  
      someinfo = db.Column(db.String(ID_LEN), primary_key=True)
      department_id = db.Column(db.String(500), db.ForeignKey('departments.dep_name_id'))
  </code></pre>
  
  <p>However after running <code>flask db migrate</code>, I get the following error (composite index column is not recognized!): </p>
  
  <pre><code>sqlalchemy.exc.NoReferencedColumnError: Could not initialize target column for ForeignKey 'deparments.dep_name_id' on table 'employees': 
  table 'departments' has no column named 'dep_name_id'
  </code></pre>