错误信息:sqlalchemy.exc.NoForeignKeysError:Couldnotdeterminejoinconditionbetweenparent/childtablesonrelationshipversion_patch.patchcode-therearenoforeignkeyslinkingthesetables.EnsurethatreferencingcolumnsareassociatedwithaForeignKeyorForeignKeyConstraint,orspecifya'primaryjoin'expression.代码:classtrans_inst(db.Model):__tablename__='TRANS_INST'__table_args__=SCHEMA#查询带上库名前缀TRANS_ID=db.Column(db.INTEGER,primary_key=True)TITLE=db.Column(db.VARCHAR(255),nullable=False)VERSION_ID=db.Column(db.INTEGER)PROJECT_ID=db.Column(db.INTEGER,nullable=False)TEMPLET_ID=db.Column(db.INTEGER)STAFF_ID=db.Column(db.INTEGER,nullable=False)CREATE_DATE=db.Column(db.DATE)STATE=db.Column(db.CHAR(1))PATCH_ID=db.Column(db.INTEGER,db.ForeignKey('version_patch.PATCH_ID'))UP_TRANS_ID=db.Column(db.INTEGER)#子单/关联单IDTYPE=db.Column(db.CHAR(1))#子单关联单类型SUBMITTER=db.Column(db.INTEGER)classversion_patch(db.Model):"""补丁(版本)定义表"""__tablename__='VERSION_PATCH'__table_args__=SCHEMA#查询带上库名前缀PATCH_ID=db.Column(db.INTEGER,primary_key=True)VERSION_ID=db.Column(db.INTEGER)#版本标识UP_PATCH_ID=db.Column(db.INTEGER)PATCH_CODE=db.Column(db.VARCHAR(255))patchcode=db.relationship("trans_inst")
回首忆惘然
蝴蝶刀刀
相关分类