I have a problem with SqlAlchemy. When I define the schema in my Oracle database, foreign keys are not recognized in other tables. Tested without using layout and it worked. But I need to define the schema of this application because the user is not the owner of the tables. I would like your help to solve this problem. code:
Base = declarative_base()
SCHEMA = {'schema' : 'SIATDESV'}
class Pgdasd(Base):
__tablename__ = 'PGDASD'
__table_args__ = SCHEMA
PGDASD_00000_ID_DECLARACAO = Column(String(17), primary_key = True)
class Pgdasd_01000(Base):
__tablename__ = 'pgdasd_01000'
__table_args__ = SCHEMA
PGDASD_00000_ID_DECLARACAO = Column(String, ForeignKey('PGDASD.PGDASD_00000_ID_DECLARACAO'))
PGDASD_01000_NRPAGTO = Column(String, primary_key = True)
error: *Foreign key associated with column 'pgdasd_01000.PGDASD_00000_ID_DECLARACAO' could not find table 'PGDASD' with which to generate a foreign key to target column 'PGDASD_00000_ID_DECLARACAO'*
thanks!