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

Added posts.updated_at index to schema #20357

Merged
merged 4 commits into from
Jun 10, 2024
Merged

Added posts.updated_at index to schema #20357

merged 4 commits into from
Jun 10, 2024

Conversation

9larsons
Copy link
Contributor

ref 6dbbdff

  • added index to schema

9larsons added 2 commits June 10, 2024 10:12
ref https://linear.app/tryghost/issue/ONC-82
- added migration for adding a posts.updated_at index

The default order by clause is published_at desc. It makes sense that users may want to return the latest updated posts instead of the last published. Currently we don't have an index for this and it makes for slow data fetching.
ref 6dbbdff
- forgot to update schema with migration
@9larsons 9larsons changed the title Fix updated at index Fixed updated at index Jun 10, 2024
Copy link
Contributor

It looks like this PR contains a migration 👀
Here's the checklist for reviewing migrations:

General requirements

  • Satisfies idempotency requirement (both up() and down())
  • Does not reference models
  • Filename is in the correct format (and correctly ordered)
  • Targets the next minor version
  • All code paths have appropriate log messages
  • Uses the correct utils
  • Contains a minimal changeset
  • Does not mix DDL/DML operations

Schema changes

  • Both schema change and related migration have been implemented
  • For index changes: has been performance tested for large tables
  • For new tables/columns: fields use the appropriate predefined field lengths
  • For new tables/columns: field names follow the appropriate conventions
  • Does not drop a non-alpha table outside of a major version

Data changes

  • Mass updates/inserts are batched appropriately
  • Does not loop over large tables/datasets
  • Defends against missing or invalid data
  • For settings updates: follows the appropriate guidelines

@github-actions github-actions bot added the migration [pull request] Includes migration for review label Jun 10, 2024
@9larsons 9larsons changed the title Fixed updated at index Added posts.updated_at index to schema Jun 10, 2024
@9larsons
Copy link
Contributor Author

Can ignore the migration checklist - it was pulled in from a stale branch, fixed via rebase.

@9larsons 9larsons merged commit 3c247d9 into main Jun 10, 2024
22 checks passed
@9larsons 9larsons deleted the fix-updated-at-index branch June 10, 2024 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
migration [pull request] Includes migration for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant