Skip to content

Commit

Permalink
Merge pull request #2243 from hongwei1/refactor/removeHasOwnerViewAccess
Browse files Browse the repository at this point in the history
bugfix/tweaked the position to run populateMigrationOfViewDefinitionP…
  • Loading branch information
simonredfern authored Jul 14, 2023
2 parents 8291d72 + ae994f3 commit f4fc319
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions obp-api/src/main/scala/code/api/util/migration/Migration.scala
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ object Migration extends MdcLoggable {
dummyScript()
addAccountAccessConsumerId()
populateTableViewDefinition()
populateMigrationOfViewDefinitionPermissions()
populateMigrationOfViewDefinitionPermissions(startedBeforeSchemifier)
populateTableAccountAccess()
generateAndPopulateMissingCustomerUUIDs(startedBeforeSchemifier)
generateAndPopulateMissingConsumersUUIDs(startedBeforeSchemifier)
Expand Down Expand Up @@ -129,10 +129,15 @@ object Migration extends MdcLoggable {
}


private def populateMigrationOfViewDefinitionPermissions(): Boolean = {
val name = nameOf(populateMigrationOfViewDefinitionPermissions)
runOnce(name) {
MigrationOfViewDefinitionPermissions.populate(name)
private def populateMigrationOfViewDefinitionPermissions(startedBeforeSchemifier: Boolean): Boolean = {
if (startedBeforeSchemifier == true) {
logger.warn(s"Migration.database.populateMigrationOfViewDefinitionPermissions(true) cannot be run before Schemifier.")
true
} else {
val name = nameOf(populateMigrationOfViewDefinitionPermissions(startedBeforeSchemifier))
runOnce(name) {
MigrationOfViewDefinitionPermissions.populate(name)
}
}
}

Expand Down

0 comments on commit f4fc319

Please sign in to comment.