I am using sqlalchemy to create two tables in the following:
class Classroom(Base): __tablename__ = 'classroom' building = Column(String(256), primary_key = True) room_no = Column(String(256), primary_key = True) capacity = Column(Integer) class Section(Base): __tablename__ = 'section' course_id = Column(String(256), ForeignKey('course.course_id'), primary_key = True) building = Column(String(256), ForeignKey('classroom.building')) room_no = Column(String(256), ForeignKey('classroom.room_no')) However, I got the error saying:
sqlalchemy.exc.ProgrammingError: (ProgrammingError) there is no unique constraint matching given keys for referenced table "classroom"