Skip to content

Commit

Permalink
Duplicate the Migration009 script so it can run again to fix missing …
Browse files Browse the repository at this point in the history
…RepairSegment startTimes
  • Loading branch information
michaelsembwever committed Nov 23, 2017
1 parent b56ce12 commit 5a14d92
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/*
* 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 io.cassandrareaper.storage.cassandra;


import com.datastax.driver.core.Session;

public final class Migration011 {

private Migration011() {
}

/**
* fix segment start and end times in the repair_run table.
* delegates to Migration009 as that does everything already.
*/
public static void migrate(Session session) {
Migration009.migrate(session);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--
-- Intentionally blank
--
-- Placeholder for Migration011
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--
-- fix segment start and end times in the repair_run table
--

UPDATE repair_segment
SET start_time = end_time
WHERE start_time is NULL
AND end_time IS NOT NULL;


Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
--
-- fix segment start and end times in the repair_run table
--

UPDATE repair_segment
SET start_time = end_time
WHERE start_time is NULL
AND end_time IS NOT NULL;


0 comments on commit 5a14d92

Please sign in to comment.