This is caused because some integer fields are primary keys, and SQLAlchemy automatically makes these autoincrement. Will need to create an alembic migration to ensure that there is no autoincrement on these fields.
Eg. rel_entity_position_seq, rel_text_position_seq