PART 2 · GRAPHICAL CLIENT AND REVERSE ER DIAGRAM
Reverse ER Diagram in DBeaver: A Comparison of Ideal and Reality
The diagram in dbdiagram.io shows what you wanted to create. The diagram in DBeaver shows what was actually created in the DBMS.
Step 1. Connect DBeaver to the container
• Create a PostgreSQL connection: Host localhost, Port 5435, Database gamedb, User postgres.
• On the PostgreSQL tab, check the “Show all databases” box to view all test databases (including gamedb_restore_check).
Step 2. Open the Reverse Engineering ER Diagram
• In the Database Navigator tree, expand: gamedb → Schemas → game.
• Double-click the game schema → switch to the ER Diagram tab at the top of the window.
• DBeaver reads the pg_catalog and pg_constraint system catalogs and automatically draws the tables with all their relationships.
Step 3. What immediately causes DDL errors in the reverse schema
• The table is floating without any foreign keys: we forgot to specify FOREIGN KEY ... REFERENCES when migrating from DBML.
• There is no key icon next to the columns in the join table: we forgot the composite PRIMARY KEY (match_id, player_id).
• The relationship in `kill_log` is single instead of dual: the foreign key was set only on `match_id` instead of the pair (`match_id`, `killer_id`).
Artifact for Exercise 5: Exporting a reverse ER diagram from DBeaver to PNG—required proof that all foreign keys have actually been created in the database.