mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:17:09 +00:00
Fix migration script log issue
This commit is contained in:
parent
68d1826465
commit
b02f70eeee
@ -1,19 +1,32 @@
|
||||
package code.migration
|
||||
|
||||
import code.util.Helper.MdcLoggable
|
||||
import net.liftweb.common.Full
|
||||
import net.liftweb.mapper.By
|
||||
|
||||
object MappedMigrationScriptLogProvider extends MigrationScriptLogProvider with MdcLoggable {
|
||||
override def saveLog(name: String, commitId: String, isSuccessful: Boolean, startDate: Long, endDate: Long, comment: String): Boolean = {
|
||||
MigrationScriptLog
|
||||
.create
|
||||
.Name(name)
|
||||
.CommitId(commitId)
|
||||
.IsSuccessful(isSuccessful)
|
||||
.StartDate(startDate)
|
||||
.EndDate(endDate)
|
||||
.Remark(comment)
|
||||
.save()
|
||||
MigrationScriptLog.find(By(MigrationScriptLog.Name, name), By(MigrationScriptLog.IsSuccessful, isSuccessful)) match {
|
||||
case Full(log) =>
|
||||
log
|
||||
.Name(name)
|
||||
.CommitId(commitId)
|
||||
.IsSuccessful(isSuccessful)
|
||||
.StartDate(startDate)
|
||||
.EndDate(endDate)
|
||||
.Remark(comment)
|
||||
.save()
|
||||
case _ =>
|
||||
MigrationScriptLog
|
||||
.create
|
||||
.Name(name)
|
||||
.CommitId(commitId)
|
||||
.IsSuccessful(isSuccessful)
|
||||
.StartDate(startDate)
|
||||
.EndDate(endDate)
|
||||
.Remark(comment)
|
||||
.save()
|
||||
}
|
||||
}
|
||||
override def isExecuted(name: String): Boolean = {
|
||||
MigrationScriptLog.find(
|
||||
|
||||
Loading…
Reference in New Issue
Block a user