Add user preference to disable showing size bars in change tables

Some users dislike the rainbow colored bars in the change tables that
indicate the change sizes. Add a preference setting to allow users to
switch between colored bars and text representation of the change
size.

Bug: issue 2299
Change-Id: I689c3cebf21252d7f70a5df1d312c179189d10fc
Signed-off-by: Edwin Kempin <edwin.kempin@sap.com>
This commit is contained in:
Edwin Kempin
2013-12-06 08:43:22 +01:00
parent 6c0cae6972
commit 13e03a7631
9 changed files with 83 additions and 6 deletions

View File

@@ -32,7 +32,7 @@ import java.util.List;
/** A version of the database schema. */
public abstract class SchemaVersion {
/** The current schema version. */
public static final Class<Schema_89> C = Schema_89.class;
public static final Class<Schema_90> C = Schema_90.class;
public static class Module extends AbstractModule {
@Override

View File

@@ -0,0 +1,40 @@
// Copyright (C) 2013 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package com.google.gerrit.server.schema;
import com.google.gerrit.reviewdb.server.ReviewDb;
import com.google.gwtorm.jdbc.JdbcSchema;
import com.google.inject.Inject;
import com.google.inject.Provider;
import java.sql.SQLException;
import java.sql.Statement;
public class Schema_90 extends SchemaVersion {
@Inject
Schema_90(Provider<Schema_89> prior) {
super(prior);
}
@Override
protected void migrateData(ReviewDb db, UpdateUI ui) throws SQLException {
Statement stmt = ((JdbcSchema) db).getConnection().createStatement();
try {
stmt.executeUpdate("UPDATE accounts set size_bar_in_change_table = 'Y'");
} finally {
stmt.close();
}
}
}