-
-
Notifications
You must be signed in to change notification settings - Fork 362
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
Add a script to reindex files or change how we id #121
Comments
This is coming off of a short discussion here: #119 |
For id, I'd just use the name and normalize it with regexes, like this:
This has the advantage to be deterministic and usually unique because, in the SRD, names are unique. I think regexes are a good fit because they can be used in any language so no matter the scripting language, it will just work. Also, those regex can be simplified or aggregated, but I haven't found a single regex to do all that at once. |
I think that's a reasonable ID pattern. |
So that would convert |
I just hope that doesn't break anything for anyone. |
That will definitely break something for someone. But keeping changing the ids because we remove or add stuff will also definitely break something for someone. The change will break everything for everyone, but after that nothing will break for no one. |
If we're going to do this, we may as well drop the domain from the URL as well. |
Actually, that would be a pretty good use for a repository tag. Since essentially that would be a major version change. |
@ogregoire If you want to pull the trigger on this, feel free to. I think I'm about to have my hands full. |
I added a PR to address #113 which drops the domain from the URLs. |
I also started throwing together a script to do the ID conversion. |
Well. That might do it but I probably messed something up. |
Okay. I think this PR is in a good state for adding string ids. |
This would probably be an all or nothing script as it would need to reindex associations as well.
Alternatively, we could set ids to not be sequential numbers. Instead have them be something random. Something akin to a UUID comes to mind. This would avoid needing to reindex ever again. But there needs to be a standard way to generate a new id.
@ogregoire @Alex-frazer Thoughts?
The text was updated successfully, but these errors were encountered: