-
Notifications
You must be signed in to change notification settings - Fork 580
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SCDF should be able to migrate a schema from 2.10 to 3.0
Currently the migration fails with a validation error. The cause of the validation error was that some commits from 2.11.x that contained flyway migration scripts were not ported to the main-3 branch. The following commits that contained flyway migrations were migrated to main-3 from the main branch. * 62ea6c5 * 6f97589 The goal of this PR is to resolve the validation error so DB migrations will work properly. A subsequent PR will be submitted will add the feature code for commit 6f97589.
- Loading branch information
Showing
39 changed files
with
1,129 additions
and
712 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
...ringframework/cloud/dataflow/server/db/migration/AbstractCreateBatchIndexesMigration.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,55 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.springframework.cloud.dataflow.common.flyway.AbstractMigration; | ||
import org.springframework.cloud.dataflow.common.flyway.SqlCommand; | ||
|
||
/** | ||
* Provide indexes to improve aggregate view performance | ||
* @author Corneil du Plessis | ||
*/ | ||
public abstract class AbstractCreateBatchIndexesMigration extends AbstractMigration { | ||
protected static final String CREATE_BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_INDEX = | ||
"create index BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_IX on BATCH_STEP_EXECUTION(JOB_EXECUTION_ID)"; | ||
protected static final String CREATE_BOOT3_BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_INDEX = | ||
"create index BOOT3_BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_IX on BOOT3_BATCH_STEP_EXECUTION(JOB_EXECUTION_ID)"; | ||
protected static final String CREATE_BOOT3_TASK_TASK_BATCH_JOB_EXECUTION_ID_INDEX = | ||
"create index BOOT3_TASK_TASK_BATCH_JOB_EXECUTION_ID_IX on BOOT3_TASK_TASK_BATCH(JOB_EXECUTION_ID)"; | ||
protected static final String CREATE_TASK_TASK_BATCH_JOB_EXECUTION_ID_INDEX = | ||
"create index TASK_TASK_BATCH_JOB_EXECUTION_ID_IX on TASK_TASK_BATCH(JOB_EXECUTION_ID)"; | ||
protected static final String CREATE_BATCH_JOB_EXECUTION_START_TIME_INDEX = | ||
"create index BATCH_JOB_EXECUTION_START_TIME_IX on BATCH_JOB_EXECUTION(START_TIME)"; | ||
protected static final String CREATE_BOOT3_BATCH_JOB_EXECUTION_START_TIME_INDEX = | ||
"create index BOOT3_BATCH_JOB_EXECUTION_START_TIME_IX on BOOT3_BATCH_JOB_EXECUTION(START_TIME)"; | ||
|
||
public AbstractCreateBatchIndexesMigration() { | ||
super(null); | ||
} | ||
|
||
@Override | ||
public List<SqlCommand> getCommands() { | ||
return Arrays.asList(SqlCommand.from(CREATE_BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_INDEX), | ||
SqlCommand.from(CREATE_BOOT3_BATCH_STEP_EXECUTION_JOB_EXECUTION_ID_INDEX), | ||
SqlCommand.from(CREATE_BOOT3_TASK_TASK_BATCH_JOB_EXECUTION_ID_INDEX), | ||
SqlCommand.from(CREATE_TASK_TASK_BATCH_JOB_EXECUTION_ID_INDEX), | ||
SqlCommand.from(CREATE_BATCH_JOB_EXECUTION_START_TIME_INDEX), | ||
SqlCommand.from(CREATE_BOOT3_BATCH_JOB_EXECUTION_START_TIME_INDEX)); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
...gframework/cloud/dataflow/server/db/migration/AbstractCreateTaskParentIndexMigration.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,45 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
import org.springframework.cloud.dataflow.common.flyway.AbstractMigration; | ||
import org.springframework.cloud.dataflow.common.flyway.SqlCommand; | ||
|
||
/** | ||
* Provide indexes to improve performance of finding child tasks. | ||
* @author Corneil du Plessis | ||
*/ | ||
public abstract class AbstractCreateTaskParentIndexMigration extends AbstractMigration { | ||
protected static final String CREATE_TASK_PARENT_INDEX = | ||
"create index TASK_EXECUTION_PARENT_IX on TASK_EXECUTION(PARENT_EXECUTION_ID)"; | ||
protected static final String CREATE_BOOT3_TASK_PARENT_INDEX = | ||
"create index BOOT3_TASK_EXECUTION_PARENT_IX on BOOT3_TASK_EXECUTION(PARENT_EXECUTION_ID)"; | ||
|
||
public AbstractCreateTaskParentIndexMigration() { | ||
super(null); | ||
} | ||
|
||
@Override | ||
public List<SqlCommand> getCommands() { | ||
return Arrays.asList( | ||
SqlCommand.from(CREATE_TASK_PARENT_INDEX), | ||
SqlCommand.from(CREATE_BOOT3_TASK_PARENT_INDEX) | ||
); | ||
} | ||
} |
22 changes: 22 additions & 0 deletions
22
...a/org/springframework/cloud/dataflow/server/db/migration/db2/V10__CreateBatchIndexes.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,22 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.db2; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateBatchIndexesMigration; | ||
|
||
public class V10__CreateBatchIndexes extends AbstractCreateBatchIndexesMigration { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...rg/springframework/cloud/dataflow/server/db/migration/db2/V11__CreateTaskParentIndex.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.db2; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateTaskParentIndexMigration; | ||
|
||
public class V11__CreateTaskParentIndex extends AbstractCreateTaskParentIndexMigration { | ||
|
||
} |
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
23 changes: 23 additions & 0 deletions
23
...g/springframework/cloud/dataflow/server/db/migration/mariadb/V11__CreateBatchIndexes.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.mariadb; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateBatchIndexesMigration; | ||
|
||
public class V11__CreateBatchIndexes extends AbstractCreateBatchIndexesMigration { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...pringframework/cloud/dataflow/server/db/migration/mariadb/V12__CreateTaskParentIndex.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.mariadb; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateTaskParentIndexMigration; | ||
|
||
public class V12__CreateTaskParentIndex extends AbstractCreateTaskParentIndexMigration { | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
...org/springframework/cloud/dataflow/server/db/migration/mysql/V11__CreateBatchIndexes.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,22 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.mysql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateBatchIndexesMigration; | ||
|
||
public class V11__CreateBatchIndexes extends AbstractCreateBatchIndexesMigration { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
.../springframework/cloud/dataflow/server/db/migration/mysql/V12__CreateTaskParentIndex.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.mysql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateTaskParentIndexMigration; | ||
|
||
public class V12__CreateTaskParentIndex extends AbstractCreateTaskParentIndexMigration { | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
...rg/springframework/cloud/dataflow/server/db/migration/oracle/V11__CreateBatchIndexes.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,22 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.oracle; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateBatchIndexesMigration; | ||
|
||
public class V11__CreateBatchIndexes extends AbstractCreateBatchIndexesMigration { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...springframework/cloud/dataflow/server/db/migration/oracle/V12__CreateTaskParentIndex.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.oracle; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateTaskParentIndexMigration; | ||
|
||
public class V12__CreateTaskParentIndex extends AbstractCreateTaskParentIndexMigration { | ||
|
||
} |
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
22 changes: 22 additions & 0 deletions
22
...pringframework/cloud/dataflow/server/db/migration/postgresql/V12__CreateBatchIndexes.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,22 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.postgresql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateBatchIndexesMigration; | ||
|
||
public class V12__CreateBatchIndexes extends AbstractCreateBatchIndexesMigration { | ||
|
||
} |
23 changes: 23 additions & 0 deletions
23
...ngframework/cloud/dataflow/server/db/migration/postgresql/V13__CreateTaskParentIndex.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,23 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* 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 | ||
* | ||
* https://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 org.springframework.cloud.dataflow.server.db.migration.postgresql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractCreateTaskParentIndexMigration; | ||
|
||
public class V13__CreateTaskParentIndex extends AbstractCreateTaskParentIndexMigration { | ||
|
||
} |
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
Oops, something went wrong.