Skip to content

Update table schema #451

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Update table schema #451

wants to merge 1 commit into from

Conversation

is-yusuf
Copy link

When exporting a diagram that contains a table with indices to JSON then importing it, an validation error occurs because the schema for the index on the table was not correctly setup leading to the file being considered an invalid json.
image

These are the errors thrown by an online validator using the old schema for reference
image

When exporting a diagram that contains a table with indices to JSON then importing it, an validation error occurs because the schema for the index on the table was not correctly setup leading to the file being considered an invalid json.
Copy link

vercel bot commented May 18, 2025

@is-yusuf is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

vercel bot commented May 18, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drawdb ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 18, 2025 10:40am

@1ilit
Copy link
Member

1ilit commented May 18, 2025

hey, can you give an example of a json file that fails the validation. the indices are stored as an array of strings
image

@is-yusuf
Copy link
Author

Strange, my fields are stored as an array of objects. This could be an import from SQL error instead. I'll update when I have new findings.

"fields": [
{
"expr": {
"type": "default",
"value": "authuser_id"
}
}
]

@1ilit
Copy link
Member

1ilit commented May 18, 2025

@is-yusuf i think i know what might have happened. did you by chance import the diagram from sql? my suspicion is that the index didnt get properly parsed after getting imported thats why it's imported as an expr

@is-yusuf
Copy link
Author

Yup, I imported the diagram from SQL at the beginning

@is-yusuf
Copy link
Author

Here's the most minimal SQL that when imported then exported to JSON reproduces the parsing error

CREATE TABLE table1 (
column1 DOUBLE PRECISION NOT NULL
);

CREATE INDEX idx_table1_column1
ON table1(column1);

@1ilit
Copy link
Member

1ilit commented May 18, 2025

yep, it's the import that needs to be fixed. would you like to fix it or do i go ahead with it?

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