mirror of
https://github.com/OpenBankProject/OBP-API.git
synced 2026-02-06 17:56:46 +00:00
feature/Improved the migration scripts
This commit is contained in:
parent
ddd90b8092
commit
87bd1975ff
@ -6,6 +6,7 @@ import java.time.{ZoneId, ZonedDateTime}
|
||||
import code.api.util.APIUtil
|
||||
import code.api.util.migration.Migration.{DbFunction, saveLog}
|
||||
import code.consent.MappedConsent
|
||||
import net.liftweb.common.Full
|
||||
import net.liftweb.mapper.{DB, Schemifier}
|
||||
import net.liftweb.util.DefaultConnectionIdentifier
|
||||
|
||||
@ -24,7 +25,12 @@ object MigrationOfMappedConsent {
|
||||
|
||||
val executedSql =
|
||||
DbFunction.maybeWrite(true, Schemifier.infoF _, DB.use(DefaultConnectionIdentifier){ conn => conn}) {
|
||||
() => "ALTER TABLE mappedconsent ALTER COLUMN mjsonwebtoken type text;"
|
||||
APIUtil.getPropsValue("db.driver") match {
|
||||
case Full(value) if value.contains("com.microsoft.sqlserver.jdbc.SQLServerDriver") =>
|
||||
() => "ALTER TABLE mappedconsent ALTER COLUMN mjsonwebtoken text;"
|
||||
case _ =>
|
||||
() => "ALTER TABLE mappedconsent ALTER COLUMN mjsonwebtoken type text;"
|
||||
}
|
||||
}
|
||||
|
||||
val endDate = System.currentTimeMillis()
|
||||
|
||||
@ -24,7 +24,7 @@ object MigrationOfMappedUserAuthContext {
|
||||
|
||||
val executedSql =
|
||||
DbFunction.maybeWrite(true, Schemifier.infoF _, DB.use(DefaultConnectionIdentifier){ conn => conn}) {
|
||||
() => "DROP INDEX mappeduserauthcontext_muserid_mkey;"
|
||||
() => "DROP INDEX IF EXISTS mappeduserauthcontext_muserid_mkey;"
|
||||
}
|
||||
|
||||
val endDate = System.currentTimeMillis()
|
||||
|
||||
@ -24,7 +24,7 @@ object MigrationOfMappedUserAuthContextUpdate {
|
||||
|
||||
val executedSql =
|
||||
DbFunction.maybeWrite(true, Schemifier.infoF _, DB.use(DefaultConnectionIdentifier){ conn => conn}) {
|
||||
() => "DROP INDEX mappeduserauthcontextupdate_muserid_mkey;"
|
||||
() => "DROP INDEX IF EXISTS mappeduserauthcontextupdate_muserid_mkey;"
|
||||
}
|
||||
|
||||
val endDate = System.currentTimeMillis()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user