mirror of
https://github.com/documize/community.git
synced 2025-07-24 15:49:44 +02:00
sync Keycloak users with Documize
This commit is contained in:
parent
b2620e80e1
commit
8c062d592a
11 changed files with 178 additions and 55 deletions
|
@ -38,7 +38,7 @@ var dbPtr **sqlx.DB
|
|||
func Check(Db *sqlx.DB, connectionString string) bool {
|
||||
dbPtr = &Db
|
||||
|
||||
log.Info("Running database checks, this may take a while...")
|
||||
log.Info("Database checks: started")
|
||||
|
||||
csBits := strings.Split(connectionString, "/")
|
||||
if len(csBits) > 1 {
|
||||
|
@ -73,8 +73,8 @@ func Check(Db *sqlx.DB, connectionString string) bool {
|
|||
// MySQL and Percona share same version scheme (e..g 5.7.10).
|
||||
// MariaDB starts at 10.2.x
|
||||
sqlVariant := GetSQLVariant(dbComment)
|
||||
log.Info("SQL variant: " + sqlVariant)
|
||||
log.Info("SQL version: " + version)
|
||||
log.Info("Database checks: SQL variant " + sqlVariant)
|
||||
log.Info("Database checks: SQL version " + version)
|
||||
|
||||
verNums, err := GetSQLVersion(version)
|
||||
if err != nil {
|
||||
|
|
|
@ -211,7 +211,7 @@ func Migrate(ConfigTableExists bool) error {
|
|||
if err != nil {
|
||||
return migrateEnd(tx, err, amLeader)
|
||||
}
|
||||
log.Info("Database checks: last previously applied file was " + lastMigration)
|
||||
log.Info("Database checks: last applied " + lastMigration)
|
||||
}
|
||||
|
||||
mig, err := migrations(lastMigration)
|
||||
|
@ -220,7 +220,7 @@ func Migrate(ConfigTableExists bool) error {
|
|||
}
|
||||
|
||||
if len(mig) == 0 {
|
||||
log.Info("Database checks: no updates to perform")
|
||||
log.Info("Database checks: no updates required")
|
||||
return migrateEnd(tx, nil, amLeader) // no migrations to perform
|
||||
}
|
||||
|
||||
|
@ -233,7 +233,7 @@ func Migrate(ConfigTableExists bool) error {
|
|||
targetMigration := string(mig[len(mig)-1])
|
||||
for targetMigration != lastMigration {
|
||||
time.Sleep(time.Second)
|
||||
log.Info("Waiting for database migration process to complete")
|
||||
log.Info("Waiting for database migration completion")
|
||||
tx.Rollback() // ignore error
|
||||
tx, err := (*dbPtr).Beginx() // need this in order to see the changed situation since last tx
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue