pgcontents icon indicating copy to clipboard operation
pgcontents copied to clipboard

pgcontents init issue

Open hesiyuan opened this issue 2 years ago • 2 comments

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]

hesiyuan avatar May 05 '22 21:05 hesiyuan

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'
    #)

gogasca avatar Sep 18 '22 09:09 gogasca

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.

hillarysanders avatar Sep 18 '24 22:09 hillarysanders