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

Changing slugs #49

Closed
davenquinn opened this issue Apr 26, 2024 · 1 comment
Closed

Changing slugs #49

davenquinn opened this issue Apr 26, 2024 · 1 comment
Assignees

Comments

@davenquinn
Copy link
Member

davenquinn commented Apr 26, 2024

Slugs for maps must be auto-generated in some cases but are meant to be human-readable. Their core use is to drive semantically useful permalinks and unique identity within (and ideally between) Macrostrat instances.

We have a few situations where slugs may need to be adjusted after map creation for maximum semantic meaning. One example is the State Geologic Map Compilation, which is in our system as gmus2 currently. sgmc would be a more meaningful slug for this map.

There are a few issues that might arise around changing slugs.

  • Permalinks could break (maybe this is acceptable). But if it isn't we'll need to maintain a separate table of "prior slugs" that redirects. This would enable GitHub-like resolution of projects even after names have been changed.
  • Slugs are now used to create the prefix for map ingestion tables. Maybe this needs to be decoupled into a separate field that is not updated when slugs are changed. With standard URL rules, it seems ideal that slugs should eventually be "kebab-case" identifiers, so maybe this decoupling will allow the tables to conform to standard rules. Alternatively, it may not be too hard to rename the tables on slug changes.

Ideally, we'd eventually have a single set of practices for slug handling across maps, columns, and projects.

@brianaydemir
Copy link
Collaborator

Alternatively, it may not be too hard to rename the tables on slug changes.

I was thinking about this while working through #50.

ALTER TABLE ... RENAME TO ... statements seem straightforward enough to me, but we might need to be careful with transactions to ensure that the database doesn't get left in an inconsistent state if (when?) something goes wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants