Originally created by: ChronicallyJD
ER Diagram generation failed with "Can not create edge with nonexistant
target" whenever a foreign key referenced a table whose name required
quoting (e.g. contained uppercase characters).
Root cause: draw_graph() keyed graph nodes by the raw, unquoted table
name from QueryTables, but built foreign-key edges from
QueryTablesForeignKeys, which returns names via quote_ident(). For names
needing quotes the node id (Testtable) and the edge target ("Testtable")
diverged, so Cytoscape could not find the target node and aborted rendering.
Fix:
name_raw), keep the unquoted name asname_raw quoted for every table while its FK pragma metadata isis_fk/is_pk column-flag lookups.html_id generation in the ERD tab: the sanitizing regex lacked thedocument.querySelector() in adjustSizes() threw on the invalidTesting: adds regression tests for PostgreSQL (live server) and SQLite
(temp file, no server needed). Both fail without their respective fixes and
pass with them.
Note: ERD layouts saved before this change store unquoted node ids, so
tables whose names require quoting lose their saved position once after
upgrading (they reappear via new_nodes); positions of all other tables are
preserved.
Fixes [#882]