Ok so I am making some automations with python for work. Essentially I am reading data from a master excel sheet, making the data look nice and uniform, and updating the changes into an Access database which other things read from.
new_df.set_index("ContractID", inplace=True)new_df.to_sql('Test', access_engine, index=True, if_exists='replace', dtype={"ContractID": sqlalchemy_access.ShortText})when doing this it removes "ContractID" as the primary key in the Test table, and breaks the existing relationship it has to another table. Is there anyway to get it so when I replace the table it keeps the existing connections?
What i tried so far is whats up in the code, setting it to index and defining explicitly the datatype of ContractID. This makes it match the datatype in the other table I want to link it to but it breaks the relationship