forked from spring-cloud/spring-cloud-dataflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Schema to retrieve EXECUTION_CONTEXT.
- Loading branch information
Corneil du Plessis
committed
Dec 13, 2023
1 parent
9f9fdc2
commit ae76c43
Showing
19 changed files
with
154 additions
and
2 deletions.
There are no files selected for viewing
46 changes: 46 additions & 0 deletions
46
...ngframework/cloud/dataflow/server/db/migration/AbstractAggregateContextViewMigration.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,46 @@ | ||
/* | ||
* 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; | ||
|
||
import org.springframework.cloud.dataflow.common.flyway.AbstractMigration; | ||
import org.springframework.cloud.dataflow.common.flyway.SqlCommand; | ||
|
||
import java.util.Arrays; | ||
import java.util.List; | ||
|
||
public abstract class AbstractAggregateContextViewMigration extends AbstractMigration { | ||
public AbstractAggregateContextViewMigration() { | ||
super(null); | ||
} | ||
|
||
public final static String CREATE_AGGREGATE_JOB_EXECUTION_CONTEXT_VIEW = "CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS\n" + | ||
" SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT\n" + | ||
"UNION ALL\n" + | ||
" SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT"; | ||
|
||
public final static String CREATE_AGGREGATE_STEP_EXECUTION_CONTEXT_VIEW = "CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS\n" + | ||
" SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT\n" + | ||
"UNION ALL\n" + | ||
" SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT"; | ||
|
||
@Override | ||
public List<SqlCommand> getCommands() { | ||
return Arrays.asList( | ||
SqlCommand.from(CREATE_AGGREGATE_JOB_EXECUTION_CONTEXT_VIEW), | ||
SqlCommand.from(CREATE_AGGREGATE_STEP_EXECUTION_CONTEXT_VIEW) | ||
); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...org/springframework/cloud/dataflow/server/db/migration/db2/V10__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.db2; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V10__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
6 changes: 6 additions & 0 deletions
6
...springframework/cloud/dataflow/server/db/migration/mariadb/V11__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.mariadb; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V11__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
6 changes: 6 additions & 0 deletions
6
...g/springframework/cloud/dataflow/server/db/migration/mysql/V11__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.mysql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V11__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
6 changes: 6 additions & 0 deletions
6
.../springframework/cloud/dataflow/server/db/migration/oracle/V11__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.oracle; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V11__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
6 changes: 6 additions & 0 deletions
6
...ingframework/cloud/dataflow/server/db/migration/postgresql/V12__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.postgresql; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V12__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
6 changes: 6 additions & 0 deletions
6
...ringframework/cloud/dataflow/server/db/migration/sqlserver/V10__AggregateContextView.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,6 @@ | ||
package org.springframework.cloud.dataflow.server.db.migration.sqlserver; | ||
|
||
import org.springframework.cloud.dataflow.server.db.migration.AbstractAggregateContextViewMigration; | ||
|
||
public class V10__AggregateContextView extends AbstractAggregateContextViewMigration { | ||
} |
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
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
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
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
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
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
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/db2/V9-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/mariadb/V11-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/mysql/V10-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/oracle/V9-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/postgresql/V10-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |
9 changes: 9 additions & 0 deletions
9
spring-cloud-dataflow-server-core/src/main/resources/schemas/sqlserver/V9-dataflow.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,9 @@ | ||
CREATE VIEW AGGREGATE_JOB_EXECUTION_CONTEXT AS | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_JOB_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT JOB_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_JOB_EXECUTION_CONTEXT; | ||
|
||
CREATE VIEW AGGREGATE_STEP_EXECUTION_CONTEXT AS | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot2' AS SCHEMA_TARGET FROM BATCH_STEP_EXECUTION_CONTEXT | ||
UNION ALL | ||
SELECT STEP_EXECUTION_ID, SHORT_CONTEXT, SERIALIZED_CONTEXT, 'boot3' AS SCHEMA_TARGET FROM BOOT3_BATCH_STEP_EXECUTION_CONTEXT; |