Skip to content

Commit

Permalink
Added updated_at index to the posts table
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
9larsons committed Jun 10, 2024
1 parent 67d7aad commit bc475a3
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// For information on writing migrations, see https://www.notion.so/ghost/Database-migrations-eb5b78c435d741d2b34a582d57c24253
const {createAddIndexMigration} = require('../../utils');

module.exports = createAddIndexMigration('posts',['updated_at']);

0 comments on commit bc475a3

Please sign in to comment.