Add feed migration and cleanup

This commit is contained in:
advplyr 2023-07-05 18:18:37 -05:00
parent a4b0f6c202
commit a0bc959850
12 changed files with 138 additions and 34 deletions

View file

@ -52,8 +52,6 @@ module.exports = (sequelize) => {
enclosureSize: oldEpisode.enclosure?.length || null,
enclosureType: oldEpisode.enclosure?.type || null,
publishedAt: oldEpisode.publishedAt,
createdAt: oldEpisode.addedAt,
updatedAt: oldEpisode.updatedAt,
podcastId: oldEpisode.podcastId,
audioFile: oldEpisode.audioFile?.toJSON() || null,
chapters: oldEpisode.chapters
@ -88,7 +86,9 @@ module.exports = (sequelize) => {
})
const { podcast } = sequelize.models
podcast.hasMany(PodcastEpisode)
podcast.hasMany(PodcastEpisode, {
onDelete: 'CASCADE'
})
PodcastEpisode.belongsTo(podcast)
return PodcastEpisode