drawdb-io / drawdb

Free, simple, and intuitive online database design tool and SQL generator.
https://drawdb.vercel.app
MIT License
12.08k stars 851 forks source link

[Bug] Problem with json import #133

Open Dev-A-Line opened 2 weeks ago

Dev-A-Line commented 2 weeks ago

Problem with json import, tables are imported, but diagrams are not.

Because of why this was needed, a bug happened and the connections moved out and stopped working, and saving without this bug was only in json.

If possible, make a timeline that will record all changes so that you can return.

image

image

Link backup json: Untitled Diagram_2024-06-07T07_42_49.051Z.json

Link bug diagram:

Untitled Diagram_2024-06-11T10_18_47.233Z.zip

1ilit commented 1 week ago

Hey! Thanks for reporting

The ddb file seems to be corrupted.

There is a relationship with the definition:

    {
      "startTableId": 9,
      "startFieldId": 7,
      "endTableId": 10,
      "endFieldId": 0,
      "cardinality": "One to one",
      "updateConstraint": "No action",
      "deleteConstraint": "No action",
      "name": "calendars_meet_id_fk",
      "id": 20
    }

and this references a column in the calendar table with the id: 7 which does not exist.

Did you by chance delete a field from the file or how did it end up referencing a column that doesn't exist?