SQLalchemy not find table for creating foreign key

前端 未结 3 665
别那么骄傲
别那么骄傲 2021-02-03 20:28

I have a problem with SQL Alchemy, while trying to create a database, i get:

\"sqlalchemy.exc.NoReferencedTableError: Foreign key associated with column \'estate         


        
3条回答
  •  Happy的楠姐
    2021-02-03 21:22

    The solution is to replace the strings with actual columns:

    Column('person_id', Integer, ForeignKey(tbl_person.c.id), primary_key=True)
    

提交回复
热议问题