Skip to content

Conversation

@hshamsadd
Copy link

No description provided.

@zamanganji
Copy link

setupDatabase(dropAndCreate) connects to postgres for DDL and to research_db for everything else. Good separation.
Table creation DDL is valid; self-referencing FK on authors.mentor is fine.
Bridge table authors_papers has a composite PK — perfect.
Inserts look syntactically correct (you escaped Liam O''Connor ).
Joins & basic aggregates will execute.

Double drop/create (wasted work)
Your top-level main() calls setupDatabase(true) and main1() calls setupDatabase(true) again. That recreates the DB twice.
Fix: Drop the first one in main() or the one in main1()—keep just one.
ADD COLUMN is not idempotent
addMentorColumn() will fail on reruns because the column already exists.

@zamanganji zamanganji self-requested a review September 18, 2025 07:30
Copy link

@zamanganji zamanganji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setupDatabase(dropAndCreate) connects to postgres for DDL and to research_db for everything else. Good separation.
Table creation DDL is valid; self-referencing FK on authors.mentor is fine.
Bridge table authors_papers has a composite PK — perfect.
Inserts look syntactically correct (you escaped Liam O''Connor ).
Joins & basic aggregates will execute.

Double drop/create (wasted work)
Your top-level main() calls setupDatabase(true) and main1() calls setupDatabase(true) again. That recreates the DB twice.
Fix: Drop the first one in main() or the one in main1()—keep just one.
ADD COLUMN is not idempotent
addMentorColumn() will fail on reruns because the column already exists.

@hshamsadd hshamsadd requested a review from zamanganji October 19, 2025 21:09
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.

2 participants