title: Flask-SQLAlchemy: there are no foreign keys linking these tables
body: <p>I'm using Flask-SQLAlchemy with the following <code>models.py</code>:</p>
  
  <pre><code>class DomainRoot(db.Model):
      # Int/Float fields
      id      = db.Column(db.Integer, primary_key=True)
  
      # String fields
      domain  = db.Column(db.String(64), index=True, unique=True)
  
      # DateTime fields
      created = db.Column(db.DateTime)
      updated = db.Column(db.DateTime)
  
      # ForeignKey relationships
      domain_paths = db.relationship('DomainPath', backref='domain_root', lazy='dynamic')
  
      def __repr__(self):
          return '&lt;DomainRoot %r&gt;' % (self.domain)
  
  class DomainPath(db.Model):
      # Int/Float fields
      id          = db.Column(db.Integer, primary_key=True)
  
      # String fields
      domain_path = db.Column(db.String(256), index=True, unique=True)
  
      # DateTime fields
      created     = db.Column(db.DateTime)
      updated     = db.Column(db.DateTime)
  
      # ForeignKey fields
      domainroot_id = db.Column(db.Integer, db.ForeignKey('domainroot.id'))
  
      def __repr__(self):
          return '&lt;DomainPath %r&gt;' % (self.domain_path)
  </code></pre>
  
  <p>When I try to query the DomainRoot object, I get an error:</p>
  
  <pre><code>InvalidRequestError: One or more mappers failed to initialize - can't proceed with initialization of other mappers. Original exception was: Could not determine join condition between parent/child tables on relationship DomainRoot.domain_paths - there are no foreign keys linking these tables. Ensure that referencing columns are associated with a ForeignKey or ForeignKeyConstraint, or specify a 'primaryjoin' expression.
  </code></pre>
  
  <p>As far as I can tell, I have added the proper foreign key fields.</p>
  
  <p>What am I doing wrong here?</p>