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
Project names cannot include upper-case letters #546
Comments
Hi Nick, had a chat with @hardillb & several ideas were explored. Would the following solution be acceptable?...
This permits us to allow mixed case names without modifying all the UI code (that currently accesses & displays) For DNS / slugs areas of the code, we can use Assuming this works and is acceptable, this solution would...
|
@Steve-Mcl this method does not allow you to push a unique constraint to the database, as the count query does not insert. Might be a downside worth considering |
@ZJvandeWeg not 100% sure I follow your meaning. Are you saying the database should have a Also, are you saying the In an ideal world, a DB constraint is the right way to go however PostGRES doesnt have the ability to set a column to case insensitive so maintaining 2 fields is the only option. As for sequelise to handle a case insensitive check on the column, the methods for SQLITE and Postgres are different... I am open to further suggestions or to implement a 2nd column - if this is the preferred method for reasons I have not considered, please let me know asap. |
If it was a virtual field, we'd have no efficient way to check the unique constraint - sequelize would have to retrieve every single record in the database and then programmatically search through the virtual fields. That is work the database is optimised to do and we should use it. To introduce this new column will require a migration - plenty of examples now to base that on. At this stage, given we don't support changing the project name, we only need to ensure the field gets populated when the project is created. |
NP. I will re-do the PR to include a DB migration and additional field. |
Hi Nick @knolleary I have revised this to add a new field The DB migration first adds the column without constraints (as it would fail), then copies the lower case value from The tests were updated to ensure TODO |
Testing on stage ok |
Current Behavior
You cannot create a project with an upper-case letter in the name.
Whilst this makes some sense as they are used for DNS names, we should support upper-case letters in the name.
It isn't entirely trivial to just relax the regex. The database model constraint is currently used to ensure unique names - but that is a case-sensitive check. We would now need to have a case-insensitive check.
Expected Behavior
No response
Steps To Reproduce
No response
Environment
The text was updated successfully, but these errors were encountered: