-
-
Notifications
You must be signed in to change notification settings - Fork 202
Cannot delete primary key #440
Comments
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
@wellingguzman — what do we need to add/track so that we know the constraint and can delete it? |
We need to find the name of the key in This is a start, but we need to make sure the key is not a compound key before dropping it. Also dropping constraint doesn't work for MySQL on Zend DB. Read here: zendframework/zend-db#36 |
So we get the constraint name, make sure it's not a compound key... but can we still delete it if there's that Zend issue? |
Dropping constraint doesn't work on Zend DB. I am not aware if there's a workaround. If we want to support we either create a workaround in Zend DB or Directus itself. |
To be honest, I don't really see this as a critical bug right now. Every collection needs a PK and won't function without one. We can't rename fields since the column name is referenced throughout settings/relationships. We are currently beholden to ZendDB, which doesn't support this and isn't really getting many updates these days. So we don't have a lot of options. We're not at a point where Directus is a full database admin tool yet, so I think we'll just need to live with this. If we port the API to Node this issue should go away. I'll downgrade this to |
The API allows you to create field with a primary key, but there's not way to delete the primary key. To delete a constraint in MySQL, it requires the name of the constraint.
The text was updated successfully, but these errors were encountered: