Unable to create text field with unique constraint from UI
Earlier there was a string field which can be added with unique constraints from checkbox, but now after the text field I don't see the checkbox there. Was that removed intentionally ?
How can I add unique constraints now If I want to ?
3 Replies
hi, thanks for bring this to our attention.
I will check with the team on Monday, but it looks to me like by mistake we took something that is meant to be applied to the new Postgres-enabled DBs and applied it also to the older-style Xata DBs.
Until then, there are two options that you could take:
* switch to a Postgres-enabled DB. This is the default now. It would require that you recreate the DB and move the data to it.
* use the API to still create the "keyword" type. I've checked and that still works.
If you are in development phase and it's easy enough, I would recommend the first option.
If you prefer the second option, I can give you a sample API call.
@tsg How can I take the schema in current xata.ts and apply it on the new pg enabled db ?
you could create pgroll migration files. until the schema.json file isn't supported for new postgress enabled database.