From 84012d9090221da442ef1d6cf9b271ef31db92a9 Mon Sep 17 00:00:00 2001 From: Nicholas Wallace Date: Sat, 19 Oct 2024 11:38:34 -0700 Subject: [PATCH] Fix: podcast episode index name --- server/migrations/v2.15.2-index-creation.js | 6 +++--- server/models/PodcastEpisode.js | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/server/migrations/v2.15.2-index-creation.js b/server/migrations/v2.15.2-index-creation.js index b4490b3e..4e9915c2 100644 --- a/server/migrations/v2.15.2-index-creation.js +++ b/server/migrations/v2.15.2-index-creation.js @@ -31,7 +31,7 @@ async function up({ context: { queryInterface, logger } }) { // Delete existing podcastEpisode index logger.info('[2.15.2 migration] Deleting existing podcastEpisode index') - await queryInterface.removeIndex('podcastEpisodes', 'podcast_episode_created_at') + await queryInterface.removeIndex('podcastEpisodes', 'podcast_episodes_created_at') // Create index for podcastEpisode and createdAt logger.info('[2.15.2 migration] Creating index for podcastEpisode and createdAt') @@ -66,9 +66,9 @@ async function down({ context: { queryInterface, logger } }) { await queryInterface.removeIndex('podcastEpisodes', 'podcastEpisode_createdAt_podcastId') // Create index for podcastEpisode and createdAt - logger.info('[2.15.2 migration] Creating index for podcastEpisode createdAt') + logger.info('[2.15.2 migration] Creating original index for podcastEpisode createdAt') await queryInterface.addIndex('podcastEpisodes', ['createdAt'], { - name: 'podcast_episode_created_at' + name: 'podcast_episodes_created_at' }) // Finished migration diff --git a/server/models/PodcastEpisode.js b/server/models/PodcastEpisode.js index 937e0b31..1f99361a 100644 --- a/server/models/PodcastEpisode.js +++ b/server/models/PodcastEpisode.js @@ -157,6 +157,7 @@ class PodcastEpisode extends Model { modelName: 'podcastEpisode', indexes: [ { + name: 'podcastEpisode_createdAt_podcastId', fields: ['createdAt', 'podcastId'] } ]