Skip to content

Commit

Permalink
Fix v2.17.0 migration to ensure mediaItemShares table exists
Browse files Browse the repository at this point in the history
  • Loading branch information
advplyr committed Nov 20, 2024
1 parent b148a57 commit ff026a0
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions server/migrations/v2.17.0-uuid-replacement.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ async function up({ context: { queryInterface, logger } }) {
type: 'UUID'
})

logger.info('[2.17.0 migration] Changing mediaItemShares.mediaItemId column to UUID')
await queryInterface.changeColumn('mediaItemShares', 'mediaItemId', {
type: 'UUID'
})
if (await queryInterface.tableExists('mediaItemShares')) {
logger.info('[2.17.0 migration] Changing mediaItemShares.mediaItemId column to UUID')
await queryInterface.changeColumn('mediaItemShares', 'mediaItemId', {
type: 'UUID'
})
} else {
logger.info('[2.17.0 migration] mediaItemShares table does not exist, skipping column change')
}

logger.info('[2.17.0 migration] Changing playbackSessions.mediaItemId column to UUID')
await queryInterface.changeColumn('playbackSessions', 'mediaItemId', {
Expand Down

0 comments on commit ff026a0

Please sign in to comment.