KEYCLOAK-2737 Remove 'databaseSchema' property from connectionsMongo

This commit is contained in:
mposolda 2016-04-01 16:54:54 +02:00
parent e02d0ed629
commit afd3a36ee4
4 changed files with 6 additions and 16 deletions

View file

@ -333,8 +333,7 @@ bin/add-user-keycloak.[sh|bat] -r master -u <username> -p <password>
"host": "127.0.0.1", "host": "127.0.0.1",
"port": "27017", "port": "27017",
"db": "keycloak", "db": "keycloak",
"connectionsPerHost": 100, "connectionsPerHost": 100
"databaseSchema": "update"
} }
} }
]]></programlisting> ]]></programlisting>

View file

@ -156,20 +156,13 @@ public class DefaultMongoConnectionFactoryProvider implements MongoConnectionPro
} }
private void update(KeycloakSession session) { private void update(KeycloakSession session) {
String databaseSchema = config.get("databaseSchema"); MongoUpdaterProvider mongoUpdater = session.getProvider(MongoUpdaterProvider.class);
if (databaseSchema != null) {
if (databaseSchema.equals("update")) {
MongoUpdaterProvider mongoUpdater = session.getProvider(MongoUpdaterProvider.class);
if (mongoUpdater == null) { if (mongoUpdater == null) {
throw new RuntimeException("Can't update database: Mongo updater provider not found"); throw new RuntimeException("Can't update database: Mongo updater provider not found");
}
mongoUpdater.update(session, db);
} else {
throw new RuntimeException("Invalid value for databaseSchema: " + databaseSchema);
}
} }
mongoUpdater.update(session, db);
} }

View file

@ -94,7 +94,6 @@
"host": "${keycloak.connectionsMongo.host:127.0.0.1}", "host": "${keycloak.connectionsMongo.host:127.0.0.1}",
"port": "${keycloak.connectionsMongo.port:27017}", "port": "${keycloak.connectionsMongo.port:27017}",
"db": "${keycloak.connectionsMongo.db:keycloak}", "db": "${keycloak.connectionsMongo.db:keycloak}",
"databaseSchema": "${keycloak.connectionsMongo.databaseSchema:update}",
"connectionsPerHost": "${keycloak.connectionsMongo.connectionsPerHost:100}" "connectionsPerHost": "${keycloak.connectionsMongo.connectionsPerHost:100}"
} }
}, },

View file

@ -73,7 +73,6 @@
"host": "${keycloak.connectionsMongo.host:127.0.0.1}", "host": "${keycloak.connectionsMongo.host:127.0.0.1}",
"port": "${keycloak.connectionsMongo.port:27017}", "port": "${keycloak.connectionsMongo.port:27017}",
"db": "${keycloak.connectionsMongo.db:keycloak}", "db": "${keycloak.connectionsMongo.db:keycloak}",
"databaseSchema": "${keycloak.connectionsMongo.databaseSchema:update}",
"connectionsPerHost": "${keycloak.connectionsMongo.connectionsPerHost:100}" "connectionsPerHost": "${keycloak.connectionsMongo.connectionsPerHost:100}"
} }
}, },