Skip to content

Commit

Permalink
Merge pull request #581 from NDLANO/arena-accepted-migration
Browse files Browse the repository at this point in the history
myndla-api: Add `arenaAccepted` field migration
  • Loading branch information
jnatten authored Jan 22, 2025
2 parents b3df459 + da926f5 commit d9ff8f0
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Part of NDLA myndla-api
* Copyright (C) 2025 NDLA
*
* See LICENSE
*
*/

package no.ndla.myndlaapi.db.migration

import io.circe.{Json, parser}
import no.ndla.database.DocumentMigration

class V17__AddArenaAcceptedField extends DocumentMigration {
override val columnName: String = "document"
override val tableName: String = "my_ndla_users"

override def convertColumn(document: String): String = {
val oldDocument = parser.parse(document).toTry.get
oldDocument.mapObject(_.add("arenaAccepted", Json.False)).noSpaces
}

}

0 comments on commit d9ff8f0

Please sign in to comment.