-
Notifications
You must be signed in to change notification settings - Fork 582
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix columns in BOOT3_BATCH_JOB_EXECUTION_PARAMS (#5544)
* Fix columns in BOOT3_BATCH_JOB_EXECUTION_PARAMS This commit introduces an Oracle schema migration that updates the BOOT3_BATCH_JOB_EXECUTION_PARAMS table to use the newer Batch5 parameter columns. Resolves #5534 * Drop and re-add the `IDENTIFYING` column (keep same order as before)
- Loading branch information
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
...dataflow/server/db/migration/oracle/V9__Boot3_Batch5_Job_Execution_Params_Column_Fix.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,53 @@ | ||
/* | ||
* Copyright 2023 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 java.util.Arrays; | ||
|
||
import org.flywaydb.core.api.migration.BaseJavaMigration; | ||
import org.flywaydb.core.api.migration.Context; | ||
|
||
import org.springframework.cloud.dataflow.common.flyway.SqlCommand; | ||
import org.springframework.cloud.dataflow.common.flyway.SqlCommandsRunner; | ||
|
||
/** | ||
* Fixes the names of the {@code BOOT3_BATCH_JOB_EXECUTION_PARAMS} parameter columns. | ||
* | ||
* @author Chris Bono | ||
*/ | ||
public class V9__Boot3_Batch5_Job_Execution_Params_Column_Fix extends BaseJavaMigration { | ||
|
||
public final static String DROP_COLUMNS_BATCH_JOB_EXECUTION_PARAMS_TABLE = | ||
"ALTER TABLE BOOT3_BATCH_JOB_EXECUTION_PARAMS DROP (TYPE_CD, KEY_NAME, STRING_VAL, DATE_VAL, " + | ||
"LONG_VAL, DOUBLE_VAL, IDENTIFYING)"; | ||
|
||
public final static String ADD_COLUMNS_BATCH_JOB_EXECUTION_PARAMS_TABLE = | ||
"ALTER TABLE BOOT3_BATCH_JOB_EXECUTION_PARAMS ADD (\n" + | ||
" PARAMETER_NAME VARCHAR(100 char) NOT NULL,\n" + | ||
" PARAMETER_TYPE VARCHAR(100 char) NOT NULL,\n" + | ||
" PARAMETER_VALUE VARCHAR(2500 char),\n" + | ||
" IDENTIFYING CHAR(1) NOT NULL\n" + | ||
")"; | ||
|
||
private final SqlCommandsRunner runner = new SqlCommandsRunner(); | ||
|
||
@Override | ||
public void migrate(Context context) throws Exception { | ||
runner.execute(context.getConnection(), Arrays.asList( | ||
SqlCommand.from(DROP_COLUMNS_BATCH_JOB_EXECUTION_PARAMS_TABLE), | ||
SqlCommand.from(ADD_COLUMNS_BATCH_JOB_EXECUTION_PARAMS_TABLE))); | ||
} | ||
} |