Schema migrations do all their work in the upgrade method. This is the place where they need to access the arguments. If the arguments are passed into the constructor, each schema migration must save the arguments in a local member veriable to make them accessible from the upgrade method. To save this boilerplate code we now directly pass the arguments into the upgrade method. This means schema versions don't need to define any constructor since the default constructor is all that is needed. Signed-off-by: Edwin Kempin <ekempin@google.com> Change-Id: Ie35d088bde76c0d11440b073034ecdae8df59a2c
23 lines
866 B
Java
23 lines
866 B
Java
// Copyright (C) 2018 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;
|
|
|
|
public class Schema_180 implements NoteDbSchemaVersion {
|
|
@Override
|
|
public void upgrade(Arguments args, UpdateUI ui) {
|
|
// Do nothing; only used to populate the version ref, which is done by the caller.
|
|
}
|
|
}
|