Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Print out SQL tables #192

Merged
merged 3 commits into from
Jan 24, 2025
Merged

ci: Print out SQL tables #192

merged 3 commits into from
Jan 24, 2025

Conversation

jpmckinney
Copy link
Member

No description provided.

@jpmckinney
Copy link
Member Author

@yolile I added the logic mentioned on Slack to Pelican frontend, but now I can't get the tests to pass. It errors:

psycopg2.errors.UndefinedTable: relation "compiled_release" does not exist
LINE 1: SELECT EXISTS (SELECT 1 FROM compiled_release WHERE collecti...

But psql -c '\d' reports:

                          List of relations
 Schema |                 Name                 |   Type   |  Owner   
--------+--------------------------------------+----------+----------
 public | compiled_release                     | table    | postgres
 public | compiled_release_id_seq              | sequence | postgres
...

There is a DATABASE_ROUTERS, but I figure the code should be selecting the database correctly...

DATABASE_ROUTERS = ["api.routers.DbRouter"]
        with connections["kingfisher_process"].cursor() as cursor:
            cursor.execute(
                "SELECT EXISTS (SELECT 1 FROM compiled_release WHERE collection_id = %(id)s)",
                {"id": collection_id},
            )

Any ideas?

@jpmckinney
Copy link
Member Author

Ahhh, Django prepends test_ to database names!

@jpmckinney jpmckinney merged commit b687935 into main Jan 24, 2025
15 checks passed
@jpmckinney jpmckinney deleted the ci-fix branch January 24, 2025 17:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant