use the old id generator as it's the one we were using before dropwizard

This commit is contained in:
Athou
2014-11-21 16:50:20 +01:00
parent 0313c5c560
commit cbc792d406
2 changed files with 8 additions and 3 deletions

View File

@@ -24,6 +24,7 @@ import javax.servlet.http.HttpServletRequest;
import org.eclipse.jetty.server.session.SessionHandler;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
import org.hibernate.cfg.AvailableSettings;
import com.commafeed.backend.feed.FeedRefreshTaskGiver;
import com.commafeed.backend.feed.FeedRefreshUpdater;
@@ -89,14 +90,18 @@ public class CommaFeedApplication extends Application<CommaFeedConfiguration> {
FeedSubscription.class, User.class, UserRole.class, UserSettings.class) {
@Override
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
return configuration.getDatabase();
DataSourceFactory factory = configuration.getDataSourceFactory();
// keep using old id generator for backward compatibility
factory.getProperties().put(AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "false");
return factory;
}
});
bootstrap.addBundle(new MigrationsBundle<CommaFeedConfiguration>() {
@Override
public DataSourceFactory getDataSourceFactory(CommaFeedConfiguration configuration) {
return configuration.getDatabase();
return configuration.getDataSourceFactory();
}
});

View File

@@ -35,7 +35,7 @@ public class CommaFeedConfiguration extends Configuration {
@Valid
@NotNull
@JsonProperty("database")
private DataSourceFactory database = new DataSourceFactory();
private DataSourceFactory dataSourceFactory = new DataSourceFactory();
@Valid
@NotNull