pgcontents
pgcontents copied to clipboard
pgcontents init issue
I'm seeing the following issue when running pgcontents init
sqlalchemy.exc.ProgrammingError: (psycopg2.errors.UndefinedObject) constraint "directories_parent_user_id_fkey" of relation "directories" does not exist
[SQL: ALTER TABLE pgcontents.directories DROP CONSTRAINT directories_parent_user_id_fkey]
Same issue. https://github.com/quantopian/pgcontents/issues/74 Is not fixed yet.
Edit
pgcontents/alembic/versions/2d46c89138b0_.py
And comment out:
# Drop the existing foreign key
#op.drop_constraint(
# 'directories_parent_user_id_fkey',
# 'directories',
# type_='foreignkey',
# schema='pgcontents'
#)
Yeah https://github.com/quantopian/pgcontents/pull/76 was supposed to fix this, but I'm also still encountering this error despite being on the most recent package version. (Though the ^^ above commenting trick fix works for me)
Edit: Ahhh so the issue was fixed, however as of now (Sep 2024), the pgcontents
package that get installed when you run pip install pgcontents
doesn't roll in the more recent updates. For that, try running
pip install git+https://github.com/quantopian/pgcontents.git
Doing this solved the issue for me.