Skip to content
This repository has been archived by the owner on Jul 1, 2024. It is now read-only.

Commit

Permalink
fix(entity-revision-merge): fix migration of video revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
hugotiburtino committed Jun 24, 2024
1 parent 95792d5 commit d1728fd
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,29 @@ export async function up(db: Database) {
count += rows.length
}

console.log('fixing the video revisions')
// see https://github.com/serlo/api.serlo.org/issues/1610
await db.runSql(
`
update entity_revision
set url = content, content = meta_description
where id in (
select er.id from (select * from entity_revision) as er
join entity on repository_id = entity.id
where type_id = 6
)
`,
)

await db.runSql(
`
update entity_revision
set content = '{"plugin":"rows","state":[{"plugin":"text"}]}'
where url is not null
and (content is null or content = '');
`,
)

console.log('dropping entity_revision_field table')
await db.dropTable('entity_revision_field')

Expand Down

0 comments on commit d1728fd

Please sign in to comment.