Error when trying to apply schema.json after I just dumped it
I'm trying to make schema changes in the schema.json file. I did
xata schema dump -f schema.json
to create the schema file and tried making edits. When I go to apply the changes using xata schema upload schema.json
I get the error Error: invalid key [checkConstraints] in request
Even if I don't make any changes and just try reapplying the schema file I just dumped.
Using Xata with Postgres enabled
Xata CLI version: @xata.io/cli/0.0.0-next.v403cdd55cb26b69c074dbc07b44daa0c2a0a77b6 win32-x64 node-v20.5.0
6 Replies
I can reproduce this, I'm checking with the team and will come back.
Thank you, even tried deleting all checkConstraints stuff and then it just errors on the other postgres stuff like foreign keys etc.
yes, what happens is that the
upload
command was not yet updated to work with the Postgres enabled databases. The good news is that there is working in progress to do it, and we might have it in a matter of days.
Unfortunatelly, I don't really have a workaround at the moment.Thanks, look forward to the update
a question: in your case, would using Postgres standard tools (e.g.
pg_dump --schema-only
) be a solution? Can you tell me a bit more about what type of changes you want to make?
The reason I ask is that it turns out that supporting schema upload
for Postgres DBs might be quite complex due to the large amount of possible optionsYeah I was just trying to use the xata cli instead, I can work around it