directus
directus copied to clipboard
Can't update a field that has a unique index
MS SQL doesn't allow altering a column that has an active unique index. I'm not sure if we should work around it in Directus itself somehow, or if this can be abstracted away in knex (ref @nickrum). Lets see how https://github.com/knex/knex/issues/4390 pans out
Should be doable 😁 I think Knex is already doing something similar for default constraints, so there is no real reason to not do the abstraction for unique indices within Knex as well.
The unique index itself can't be deleted through Directus, apparently since the drop index command is followed by an alter column command. Whenever the only change is removing the unique index, the latter is redundant, right?
This is still an issue. The only way to remove a field set as "Unique" is to delete the index directly from the database.