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

refactor: use ULIDs for items #514

Merged
merged 19 commits into from
Sep 8, 2023
Merged

refactor: use ULIDs for items #514

merged 19 commits into from
Sep 8, 2023

Conversation

iuioiua
Copy link
Contributor

@iuioiua iuioiua commented Sep 6, 2023

Please pay attention to the migration script, as it's responsible for migrating all items and votes. I've also changed all instances of monotonicUlid() to ulid() at there appears to be a bug that prevents monotonicUlid() from respecting the seedTime parameter.

The migration can be simulated as follows:

  1. Switch to main branch.
  2. Run deno run db:reset.
  3. Run deno run db:seed.
  4. Run deno task start and navigate to http://localhost:8000.
  5. Vote some items.
  6. Note the voted items and the order of the items feed.
  7. Switch to ulid-items branch.
  8. Run deno run db:migrate.
  9. Run deno task start and navigate to http://localhost:8000.
  10. Check that the voted items and the order of the items feed are identical to those previously noted.

Closes #475
Closes #476

@iuioiua iuioiua marked this pull request as ready for review September 6, 2023 06:17
@kt3k
Copy link
Member

kt3k commented Sep 6, 2023

I observed the increases of score count by 1 for the items I voted after running migration

Screenshot 2023-09-06 at 16 09 52

@iuioiua
Copy link
Contributor Author

iuioiua commented Sep 7, 2023

@kt3k, I've made some tweaks. Try now.

@kt3k
Copy link
Member

kt3k commented Sep 7, 2023

Confirmed it's fixed now 👍

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@mbhrznr mbhrznr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just gave the migration a spin.
works like a charm!
well done! 👏 👏

iuioiua added a commit that referenced this pull request Sep 8, 2023
@iuioiua iuioiua merged commit 23be24c into main Sep 8, 2023
@iuioiua iuioiua deleted the ulid-items branch September 8, 2023 01:36
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

Successfully merging this pull request may close these issues.

tracking: use ULIDs for KV-related logic todo: use ULIDs for item functionality
3 participants