Skip to content
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

Can't update a field that has a unique index #4644

Open
rijkvanzanten opened this issue Mar 23, 2021 · 3 comments
Open

Can't update a field that has a unique index #4644

rijkvanzanten opened this issue Mar 23, 2021 · 3 comments

Comments

@rijkvanzanten
Copy link
Member

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 knex/knex#4390 pans out

@nickrum
Copy link
Member

nickrum commented Apr 9, 2021

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.

@paulboudewijn
Copy link
Contributor

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?

@pmorin17
Copy link

This is still an issue. The only way to remove a field set as "Unique" is to delete the index directly from the database.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 📋 Backlog
Development

No branches or pull requests

4 participants