class Friendship(db.Model):
    __tablename__ = 'friend'
fk_user_from = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True
    )
fk_user_to = db.Column(db.Integer, db.ForeignKey('user.id'), primary_key=True)
extra_field = db.Column(db.Integer)


class User(db.Model):
    __tablename__ = 'user'
SQLAlchemy - Self referential Many-to-many relationship with extra column