-
Notifications
You must be signed in to change notification settings - Fork 217
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Duplicate the Migration009 script so it can run again to fix missing …
…RepairSegment startTimes
- Loading branch information
1 parent
b56ce12
commit 5a14d92
Showing
4 changed files
with
56 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/server/src/main/java/io/cassandrareaper/storage/cassandra/Migration011.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
4 changes: 4 additions & 0 deletions
4
src/server/src/main/resources/db/cassandra/011_fix_start_times.cql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- | ||
-- Intentionally blank | ||
-- | ||
-- Placeholder for Migration011 |
10 changes: 10 additions & 0 deletions
10
src/server/src/main/resources/db/h2/V6_0_0__fix_repair_segment_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
|
10 changes: 10 additions & 0 deletions
10
src/server/src/main/resources/db/postgres/V6_0_0__fix_repair_segment_table.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | ||
|
||
|