-
-
Notifications
You must be signed in to change notification settings - Fork 4k
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
UUID field automatically changes to "string" and can't fix it #21635
Comments
Seems like manual changing of the "special" column in directus_fields table for the given field solves the problem. But still its scary when the "type" of column changed without user permission and user can't revert it from admin panel. |
@slyk what database are you using? |
@rijkvanzanten I could reproduce this with SQLite |
Ah, that confirms my suspicion. I was assuming this would be the case for the database types where there is no native UUID, as it has to use a char(36) instead. The data model change update to remove the |
Yes its mysql or mariadb. And string is great sometimes. I could have uuids for simple items and some predefined ids for system standard items like "notfound" id for all the times that the item was searched and not found I have this "dummy" object instead of null. I just want uuid generator to work as needed when we need it :) and if possible put manual string when i need it (but that looks more like feature request not a bug) :) |
In the meantime, as an alternative to manually modifying the database, you can update the field via API 1 with the following payload: {
"meta": {
"special": ["uuid"]
}
} Footnotes |
Describe the Bug
There should be an option to switch back to UUID generation or an alert that this can't be done (when switching first time from uuid to string field). I ended up with >20000 records table that now can't automatically add new items without generating UUID manually.
There are times when need to add some existing uuid of records to the table, but still use generator for times when UUID is empty. So to do this people can just change "On Create" behavior. It changes without any warnings fast and simple. So people hope that switching it back will be just that simple... but that behaviour switching changes the type of the column. And also that type can't be changed back to UUID (while data is the same and nothing is changed).
THE BUG: "type" of the field must not be changed automatically if the user did not changing it manually in type selector.
...or at least let people to switch it back.
To Reproduce
Directus Version
v10.9.3
Hosting Strategy
Self-Hosted (Custom)
The text was updated successfully, but these errors were encountered: